diff --git a/DEPS b/DEPS index f75ce27b..4aa53b0 100644 --- a/DEPS +++ b/DEPS
@@ -40,11 +40,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '17e33cc7b0297cc567e419ea33be5707b9181c85', + 'skia_revision': '634624a1850b335aa7cdfd6aec02e687ee8571a5', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '48f67a950182d3d9e31c601baffdb0c1f09ac024', + 'v8_revision': 'cc764848c8dff30d6075981f947754f7f665af61', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -52,7 +52,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '9b11ea4f2df63784bb34ccef2456d58939a0efb9', + 'angle_revision': '79f7104ab9aa7777c0531bc6333160e7f45d9e50', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other. @@ -64,7 +64,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '5f0e64435c97755a7d309e80ea0a4dad83e76e73', + 'pdfium_revision': 'ae9c5cacce885fd6622689ecc8aab7571fb23938', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -96,7 +96,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '11749b52ff6bfe1fe8064af0865bfcd56768cb66', + 'catapult_revision': 'd27175a0446ec55e6b496d27ec64338f039eb2d1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other.
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java index d78c251..da5114a 100644 --- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java +++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java
@@ -1484,6 +1484,24 @@ return null; } + @Override + public void setRendererPriorityPolicy( + int rendererRequestedPriority, boolean waivedWhenNotVisible) { + // TODO(paulmiller): Unfork O APIs + } + + @Override + public int getRendererRequestedPriority() { + // TODO(paulmiller): Unfork O APIs + return 0; + } + + @Override + public boolean getRendererPriorityWaivedWhenNotVisible() { + // TODO(paulmiller): Unfork O APIs + return false; + } + // WebViewProvider glue methods --------------------------------------------------------------- @Override
diff --git a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java index b7cc9f72..07823e6 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java +++ b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java
@@ -13,7 +13,6 @@ import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.os.StrictMode; -import android.webkit.ValueCallback; import org.chromium.android_webview.command_line.CommandLineUtil; import org.chromium.android_webview.crash.CrashReceiverService; @@ -95,28 +94,25 @@ // We must post to the UI thread to cover the case that the user // has invoked Chromium startup by using the (thread-safe) // CookieManager rather than creating a WebView. - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - boolean multiProcess = CommandLine.getInstance().hasSwitch( - AwSwitches.WEBVIEW_SANDBOXED_RENDERER); - if (multiProcess) { - ChildProcessLauncherHelper.warmUp(appContext); - } - // The policies are used by browser startup, so we need to register the policy - // providers before starting the browser process. This only registers java objects - // and doesn't need the native library. - CombinedPolicyProvider.get().registerProvider(new AwPolicyProvider(appContext)); + ThreadUtils.runOnUiThreadBlocking(() -> { + boolean multiProcess = CommandLine.getInstance().hasSwitch( + AwSwitches.WEBVIEW_SANDBOXED_RENDERER); + if (multiProcess) { + ChildProcessLauncherHelper.warmUp(appContext); + } + // The policies are used by browser startup, so we need to register the policy + // providers before starting the browser process. This only registers java objects + // and doesn't need the native library. + CombinedPolicyProvider.get().registerProvider(new AwPolicyProvider(appContext)); - // Check android settings but only when safebrowsing is enabled. - AwSafeBrowsingConfigHelper.maybeInitSafeBrowsingFromSettings(appContext); + // Check android settings but only when safebrowsing is enabled. + AwSafeBrowsingConfigHelper.maybeInitSafeBrowsingFromSettings(appContext); - try { - BrowserStartupController.get(LibraryProcessType.PROCESS_WEBVIEW) - .startBrowserProcessesSync(!multiProcess); - } catch (ProcessInitException e) { - throw new RuntimeException("Cannot initialize WebView", e); - } + try { + BrowserStartupController.get(LibraryProcessType.PROCESS_WEBVIEW) + .startBrowserProcessesSync(!multiProcess); + } catch (ProcessInitException e) { + throw new RuntimeException("Cannot initialize WebView", e); } }); } @@ -185,18 +181,15 @@ AwBrowserProcess.handleMinidumps(webViewPackageName, true /* enabled */); } - PlatformServiceBridge.getInstance().queryMetricsSetting(new ValueCallback<Boolean>() { - // Actions conditioned on whether the Android Checkbox is toggled on - public void onReceiveValue(Boolean enabled) { - ThreadUtils.assertOnUiThread(); - if (updateMetricsConsent) { - AwMetricsServiceClient.setConsentSetting( - ContextUtils.getApplicationContext(), enabled); - } + PlatformServiceBridge.getInstance().queryMetricsSetting(enabled -> { + ThreadUtils.assertOnUiThread(); + if (updateMetricsConsent) { + AwMetricsServiceClient.setConsentSetting( + ContextUtils.getApplicationContext(), enabled); + } - if (!enableMinidumpUploadingForTesting) { - AwBrowserProcess.handleMinidumps(webViewPackageName, enabled); - } + if (!enableMinidumpUploadingForTesting) { + AwBrowserProcess.handleMinidumps(webViewPackageName, enabled); } }); }
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java index dabc79b..319845b 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -682,18 +682,15 @@ public void onTrimMemory(final int level) { boolean visibleRectEmpty = getGlobalVisibleRect().isEmpty(); final boolean visible = mIsViewVisible && mIsWindowVisible && !visibleRectEmpty; - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - if (isDestroyedOrNoOperation(NO_WARN)) return; - if (level >= TRIM_MEMORY_MODERATE) { - mInitialFunctor.deleteHardwareRenderer(); - if (mFullScreenFunctor != null) { - mFullScreenFunctor.deleteHardwareRenderer(); - } + ThreadUtils.runOnUiThreadBlocking(() -> { + if (isDestroyedOrNoOperation(NO_WARN)) return; + if (level >= TRIM_MEMORY_MODERATE) { + mInitialFunctor.deleteHardwareRenderer(); + if (mFullScreenFunctor != null) { + mFullScreenFunctor.deleteHardwareRenderer(); } - nativeTrimMemory(mNativeAwContents, level, visible); } + nativeTrimMemory(mNativeAwContents, level, visible); }); } @@ -774,12 +771,7 @@ mCurrentFunctor = mInitialFunctor; mContentsClient = contentsClient; mContentsClient.getCallbackHelper().setCancelCallbackPoller( - new AwContentsClientCallbackHelper.CancelCallbackPoller() { - @Override - public boolean cancelAllCallbacks() { - return AwContents.this.isDestroyedOrNoOperation(NO_WARN); - } - }); + () -> AwContents.this.isDestroyedOrNoOperation(NO_WARN)); mAwViewMethods = new AwViewMethodsImpl(); mFullScreenTransitionsState = new FullScreenTransitionsState( mContainerView, mInternalAccessAdapter, mAwViewMethods); @@ -795,23 +787,13 @@ mIoThreadClient = new IoThreadClientImpl(); mInterceptNavigationDelegate = new InterceptNavigationDelegateImpl(); mDisplayObserver = new AwDisplayAndroidObserver(); - mUpdateVisibilityRunnable = new Runnable() { - @Override - public void run() { - updateContentViewCoreVisibility(); - } - }; + mUpdateVisibilityRunnable = () -> updateContentViewCoreVisibility(); AwSettings.ZoomSupportChangeListener zoomListener = - new AwSettings.ZoomSupportChangeListener() { - @Override - public void onGestureZoomSupportChanged( - boolean supportsDoubleTapZoom, boolean supportsMultiTouchZoom) { - if (isDestroyedOrNoOperation(NO_WARN)) return; - mContentViewCore.updateDoubleTapSupport(supportsDoubleTapZoom); - mContentViewCore.updateMultiTouchZoomSupport(supportsMultiTouchZoom); - } - + (supportsDoubleTapZoom, supportsMultiTouchZoom) -> { + if (isDestroyedOrNoOperation(NO_WARN)) return; + mContentViewCore.updateDoubleTapSupport(supportsDoubleTapZoom); + mContentViewCore.updateMultiTouchZoomSupport(supportsMultiTouchZoom); }; mSettings.setZoomListener(zoomListener); mDefaultVideoPosterRequestHandler = new DefaultVideoPosterRequestHandler(mContentsClient); @@ -1236,12 +1218,7 @@ } mIsNoOperation = true; mIsDestroyed = true; - mHandler.post(new Runnable() { - @Override - public void run() { - destroyNatives(); - } - }); + mHandler.post(() -> destroyNatives()); } /** @@ -1432,12 +1409,7 @@ if (invalidationOnly) { mPictureListenerContentProvider = null; } else if (enabled && mPictureListenerContentProvider == null) { - mPictureListenerContentProvider = new Callable<Picture>() { - @Override - public Picture call() { - return capturePicture(); - } - }; + mPictureListenerContentProvider = () -> capturePicture(); } nativeEnableOnNewPicture(mNativeAwContents, enabled); } @@ -1472,26 +1444,20 @@ } private void requestVisitedHistoryFromClient() { - ValueCallback<String[]> callback = new ValueCallback<String[]>() { - @Override - public void onReceiveValue(final String[] value) { - if (value != null) { - // Replace null values with empty strings, because they can't be represented as - // native strings. - for (int i = 0; i < value.length; i++) { - if (value[i] == null) value[i] = ""; - } + ValueCallback<String[]> callback = value -> { + if (value != null) { + // Replace null values with empty strings, because they can't be represented as + // native strings. + for (int i = 0; i < value.length; i++) { + if (value[i] == null) value[i] = ""; } - - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - if (!isDestroyedOrNoOperation(NO_WARN)) { - nativeAddVisitedLinks(mNativeAwContents, value); - } - } - }); } + + ThreadUtils.runOnUiThread(() -> { + if (!isDestroyedOrNoOperation(NO_WARN)) { + nativeAddVisitedLinks(mNativeAwContents, value); + } + }); }; mContentsClient.getVisitedHistory(callback); } @@ -2285,20 +2251,12 @@ if (isDestroyedOrNoOperation(WARN)) return; JavaScriptCallback jsCallback = null; if (callback != null) { - jsCallback = new JavaScriptCallback() { - @Override - public void handleJavaScriptResult(final String jsonResult) { - // Post the application callback back to the current thread to ensure the - // application callback is executed without any native code on the stack. This - // so that any exception thrown by the application callback won't have to be - // propagated through a native call stack. - mHandler.post(new Runnable() { - @Override - public void run() { - callback.onReceiveValue(jsonResult); - } - }); - } + jsCallback = jsonResult -> { + // Post the application callback back to the current thread to ensure the + // application callback is executed without any native code on the stack. This + // so that any exception thrown by the application callback won't have to be + // propagated through a native call stack. + mHandler.post(() -> callback.onReceiveValue(jsonResult)); }; } @@ -2310,12 +2268,7 @@ if (isDestroyedOrNoOperation(NO_WARN)) return; JavaScriptCallback jsCallback = null; if (callback != null) { - jsCallback = new JavaScriptCallback() { - @Override - public void handleJavaScriptResult(String jsonResult) { - callback.onReceiveValue(jsonResult); - } - }; + jsCallback = jsonResult -> callback.onReceiveValue(jsonResult); } mWebContents.evaluateJavaScriptForTests(script, jsCallback); @@ -2861,12 +2814,7 @@ if (isDestroyedOrNoOperation(NO_WARN)) return; // Posting avoids invoking the callback inside invoking_composite_ // (see synchronous_compositor_impl.cc and crbug/452530). - mHandler.post(new Runnable() { - @Override - public void run() { - callback.onComplete(requestId); - } - }); + mHandler.post(() -> callback.onComplete(requestId)); } // Called as a result of nativeUpdateLastHitTestData. @@ -3024,12 +2972,7 @@ if (isDestroyedOrNoOperation(WARN)) return; JavaScriptCallback jsCallback = null; if (callback != null) { - jsCallback = new JavaScriptCallback() { - @Override - public void handleJavaScriptResult(String jsonResult) { - callback.onReceiveValue(jsonResult); - } - }; + jsCallback = jsonResult -> callback.onReceiveValue(jsonResult); } // mWebContents.evaluateJavaScript(script, jsCallback); @@ -3066,12 +3009,7 @@ private void saveWebArchiveInternal(String path, final ValueCallback<String> callback) { if (path == null || isDestroyedOrNoOperation(WARN)) { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - callback.onReceiveValue(null); - } - }); + ThreadUtils.runOnUiThread(() -> callback.onReceiveValue(null)); } else { nativeGenerateMHTML(mNativeAwContents, path, callback); }
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java index ea82a15..651521f 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java
@@ -77,31 +77,15 @@ } public void proceed(final PrivateKey privateKey, final X509Certificate[] chain) { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - proceedOnUiThread(privateKey, chain); - } - }); + ThreadUtils.runOnUiThread(() -> proceedOnUiThread(privateKey, chain)); } public void ignore() { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - ignoreOnUiThread(); - } - }); + ThreadUtils.runOnUiThread(() -> ignoreOnUiThread()); } public void cancel() { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - cancelOnUiThread(); - } - - }); + ThreadUtils.runOnUiThread(() -> cancelOnUiThread()); } private void proceedOnUiThread(PrivateKey privateKey, X509Certificate[] chain) { @@ -173,27 +157,13 @@ return false; } final SslError sslError = SslUtil.sslErrorFromNetErrorCode(certError, cert, url); - final ValueCallback<Boolean> callback = new ValueCallback<Boolean>() { - @Override - public void onReceiveValue(final Boolean value) { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - proceedSslError(value.booleanValue(), id); - } - }); - } - }; + final ValueCallback<Boolean> callback = value -> ThreadUtils.runOnUiThread( + () -> proceedSslError(value.booleanValue(), id)); // Post the application callback back to the current thread to ensure the application // callback is executed without any native code on the stack. This so that any exception // thrown by the application callback won't have to be propagated through a native call // stack. - new Handler().post(new Runnable() { - @Override - public void run() { - mClient.onReceivedSslError(callback, sslError); - } - }); + new Handler().post(() -> mClient.onReceivedSslError(callback, sslError)); return true; } @@ -246,12 +216,9 @@ // callback is executed without any native code on the stack. This so that any exception // thrown by the application callback won't have to be propagated through a native call // stack. - new Handler().post(new Runnable() { - @Override - public void run() { - JsResultHandler handler = new JsResultHandler(AwContentsClientBridge.this, id); - mClient.handleJsAlert(url, message, handler); - } + new Handler().post(() -> { + JsResultHandler handler = new JsResultHandler(AwContentsClientBridge.this, id); + mClient.handleJsAlert(url, message, handler); }); } @@ -261,12 +228,9 @@ // callback is executed without any native code on the stack. This so that any exception // thrown by the application callback won't have to be propagated through a native call // stack. - new Handler().post(new Runnable() { - @Override - public void run() { - JsResultHandler handler = new JsResultHandler(AwContentsClientBridge.this, id); - mClient.handleJsConfirm(url, message, handler); - } + new Handler().post(() -> { + JsResultHandler handler = new JsResultHandler(AwContentsClientBridge.this, id); + mClient.handleJsConfirm(url, message, handler); }); } @@ -277,12 +241,9 @@ // callback is executed without any native code on the stack. This so that any exception // thrown by the application callback won't have to be propagated through a native call // stack. - new Handler().post(new Runnable() { - @Override - public void run() { - JsResultHandler handler = new JsResultHandler(AwContentsClientBridge.this, id); - mClient.handleJsPrompt(url, message, defaultValue, handler); - } + new Handler().post(() -> { + JsResultHandler handler = new JsResultHandler(AwContentsClientBridge.this, id); + mClient.handleJsPrompt(url, message, defaultValue, handler); }); } @@ -292,12 +253,9 @@ // callback is executed without any native code on the stack. This so that any exception // thrown by the application callback won't have to be propagated through a native call // stack. - new Handler().post(new Runnable() { - @Override - public void run() { - JsResultHandler handler = new JsResultHandler(AwContentsClientBridge.this, id); - mClient.handleJsBeforeUnload(url, message, handler); - } + new Handler().post(() -> { + JsResultHandler handler = new JsResultHandler(AwContentsClientBridge.this, id); + mClient.handleJsBeforeUnload(url, message, handler); }); } @@ -377,18 +335,9 @@ } ValueCallback<AwSafeBrowsingResponse> callback = - new ValueCallback<AwSafeBrowsingResponse>() { - @Override - public void onReceiveValue(final AwSafeBrowsingResponse response) { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - nativeTakeSafeBrowsingAction(mNativeContentsClientBridge, - response.action(), response.reporting(), requestId); - } - }); - } - }; + response -> ThreadUtils.runOnUiThread( + () -> nativeTakeSafeBrowsingAction(mNativeContentsClientBridge, + response.action(), response.reporting(), requestId)); mClient.getCallbackHelper().postOnSafeBrowsingHit( request, AwSafeBrowsingConversionHelper.convertThreatType(threatType), callback);
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java b/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java index f03750db..ea5dae86 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java
@@ -106,9 +106,7 @@ List<String> urls, ValueCallback<Boolean> callback) { String[] urlArray = urls.toArray(new String[urls.size()]); if (callback == null) { - callback = new ValueCallback<Boolean>() { - @Override - public void onReceiveValue(Boolean b) {} + callback = b -> { }; } nativeSetSafeBrowsingWhitelist(urlArray, callback); @@ -119,17 +117,9 @@ public static void initSafeBrowsing(Context context, final ValueCallback<Boolean> callback) { // Wrap the callback to make sure we always invoke it on the UI thread, as guaranteed by the // API. - ValueCallback<Boolean> wrapperCallback = new ValueCallback<Boolean>() { - @Override - public void onReceiveValue(Boolean b) { - if (callback != null) { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - callback.onReceiveValue(b); - } - }); - } + ValueCallback<Boolean> wrapperCallback = b -> { + if (callback != null) { + ThreadUtils.runOnUiThread(() -> callback.onReceiveValue(b)); } };
diff --git a/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java b/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java index 1b04604..3c1713d 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java +++ b/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java
@@ -197,12 +197,7 @@ } public void onReceiveValue(final T t) { - mHandler.post(new Runnable() { - @Override - public void run() { - mCallback.onReceiveValue(t); - } - }); + mHandler.post(() -> mCallback.onReceiveValue(t)); } }
diff --git a/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java b/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java index 78dc9c3..742fc45 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java +++ b/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java
@@ -55,12 +55,7 @@ new DestroyRunnable(mNativeAwGLFunctor, mNativeDrawGLFunctor.getDestroyRunnable())); mContainerView = containerView; if (mNativeDrawGLFunctor.supportsDrawGLFunctorReleasedCallback()) { - mFunctorReleasedCallback = new Runnable() { - @Override - public void run() { - removeReference(); - } - }; + mFunctorReleasedCallback = () -> removeReference(); } else { mFunctorReleasedCallback = null; }
diff --git a/android_webview/java/src/org/chromium/android_webview/AwGeolocationPermissions.java b/android_webview/java/src/org/chromium/android_webview/AwGeolocationPermissions.java index fa75e41..97e8192 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwGeolocationPermissions.java +++ b/android_webview/java/src/org/chromium/android_webview/AwGeolocationPermissions.java
@@ -95,12 +95,7 @@ */ public void getAllowed(String origin, final ValueCallback<Boolean> callback) { final boolean finalAllowed = isOriginAllowed(origin); - ThreadUtils.postOnUiThread(new Runnable() { - @Override - public void run() { - callback.onReceiveValue(finalAllowed); - } - }); + ThreadUtils.postOnUiThread(() -> callback.onReceiveValue(finalAllowed)); } /** @@ -113,12 +108,7 @@ origins.add(name.substring(PREF_PREFIX.length())); } } - ThreadUtils.postOnUiThread(new Runnable() { - @Override - public void run() { - callback.onReceiveValue(origins); - } - }); + ThreadUtils.postOnUiThread(() -> callback.onReceiveValue(origins)); } /**
diff --git a/android_webview/java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java b/android_webview/java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java index 954b111..de6d266 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java +++ b/android_webview/java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java
@@ -73,15 +73,12 @@ } mPdfExporter.exportToPdf(destination, mAttributes, - normalizeRanges(pages), new AwPdfExporter.AwPdfExporterCallback() { - @Override - public void pdfWritingDone(int pageCount) { - if (pageCount > 0) { - callback.onWriteFinished(validatePageRanges(pages, pageCount)); - } else { - // TODO(sgurun) provide a localized error message - callback.onWriteFailed(null); - } + normalizeRanges(pages), pageCount -> { + if (pageCount > 0) { + callback.onWriteFinished(validatePageRanges(pages, pageCount)); + } else { + // TODO(sgurun) provide a localized error message + callback.onWriteFailed(null); } }, cancellationSignal); }
diff --git a/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java b/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java index f8cf124..9bea57fa 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java +++ b/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java
@@ -39,12 +39,9 @@ Class.forName("com.android.webview.chromium.AwSafeBrowsingApiHandler"); Method getUserOptInPreference = awSafeBrowsingApiHelperClass.getDeclaredMethod( getUserOptInPreferenceMethodName, Context.class, ValueCallback.class); - getUserOptInPreference.invoke(null, appContext, new ValueCallback<Boolean>() { - @Override - public void onReceiveValue(Boolean optin) { - setSafeBrowsingUserOptIn(optin == null ? false : optin); - } - }); + getUserOptInPreference.invoke(null, appContext, + (ValueCallback<Boolean>) optin -> setSafeBrowsingUserOptIn( + optin == null ? false : optin)); } catch (ClassNotFoundException e) { // This is not an error; it just means this device doesn't have specialized services. } catch (IllegalAccessException | IllegalArgumentException | NoSuchMethodException e) {
diff --git a/android_webview/java/src/org/chromium/android_webview/AwSettings.java b/android_webview/java/src/org/chromium/android_webview/AwSettings.java index 3c5c32a..3e8eae46 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwSettings.java +++ b/android_webview/java/src/org/chromium/android_webview/AwSettings.java
@@ -196,12 +196,7 @@ } void updateWebkitPreferencesLocked() { - runOnUiThreadBlockingAndLocked(new Runnable() { - @Override - public void run() { - updateWebkitPreferencesOnUiThreadLocked(); - } - }); + runOnUiThreadBlockingAndLocked(() -> updateWebkitPreferencesOnUiThreadLocked()); } } @@ -446,12 +441,9 @@ synchronized (mAwSettingsLock) { if (mInitialPageScalePercent != scaleInPercent) { mInitialPageScalePercent = scaleInPercent; - mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { - @Override - public void run() { - if (mNativeAwSettings != 0) { - nativeUpdateInitialPageScaleLocked(mNativeAwSettings); - } + mEventHandler.runOnUiThreadBlockingAndLocked(() -> { + if (mNativeAwSettings != 0) { + nativeUpdateInitialPageScaleLocked(mNativeAwSettings); } }); } @@ -545,12 +537,9 @@ synchronized (mAwSettingsLock) { if (mAutoCompleteEnabled != enable) { mAutoCompleteEnabled = enable; - mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { - @Override - public void run() { - if (mNativeAwSettings != 0) { - nativeUpdateFormDataPreferencesLocked(mNativeAwSettings); - } + mEventHandler.runOnUiThreadBlockingAndLocked(() -> { + if (mNativeAwSettings != 0) { + nativeUpdateFormDataPreferencesLocked(mNativeAwSettings); } }); } @@ -602,12 +591,9 @@ mUserAgent = ua; } if (!oldUserAgent.equals(mUserAgent)) { - mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { - @Override - public void run() { - if (mNativeAwSettings != 0) { - nativeUpdateUserAgentLocked(mNativeAwSettings); - } + mEventHandler.runOnUiThreadBlockingAndLocked(() -> { + if (mNativeAwSettings != 0) { + nativeUpdateUserAgentLocked(mNativeAwSettings); } }); } @@ -637,13 +623,10 @@ synchronized (mAwSettingsLock) { if (mLoadWithOverviewMode != overview) { mLoadWithOverviewMode = overview; - mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { - @Override - public void run() { - if (mNativeAwSettings != 0) { - updateWebkitPreferencesOnUiThreadLocked(); - nativeResetScrollAndScaleState(mNativeAwSettings); - } + mEventHandler.runOnUiThreadBlockingAndLocked(() -> { + if (mNativeAwSettings != 0) { + updateWebkitPreferencesOnUiThreadLocked(); + nativeResetScrollAndScaleState(mNativeAwSettings); } }); } @@ -1580,14 +1563,11 @@ private void onGestureZoomSupportChanged( final boolean supportsDoubleTapZoom, final boolean supportsMultiTouchZoom) { // Always post asynchronously here, to avoid doubling back onto the caller. - mEventHandler.maybePostOnUiThread(new Runnable() { - @Override - public void run() { - synchronized (mAwSettingsLock) { - if (mZoomChangeListener != null) { - mZoomChangeListener.onGestureZoomSupportChanged( - supportsDoubleTapZoom, supportsMultiTouchZoom); - } + mEventHandler.maybePostOnUiThread(() -> { + synchronized (mAwSettingsLock) { + if (mZoomChangeListener != null) { + mZoomChangeListener.onGestureZoomSupportChanged( + supportsDoubleTapZoom, supportsMultiTouchZoom); } } }); @@ -1712,12 +1692,9 @@ synchronized (mAwSettingsLock) { if (enabled != mOffscreenPreRaster) { mOffscreenPreRaster = enabled; - mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { - @Override - public void run() { - if (mNativeAwSettings != 0) { - nativeUpdateOffscreenPreRasterLocked(mNativeAwSettings); - } + mEventHandler.runOnUiThreadBlockingAndLocked(() -> { + if (mNativeAwSettings != 0) { + nativeUpdateOffscreenPreRasterLocked(mNativeAwSettings); } }); } @@ -1739,12 +1716,9 @@ @VisibleForTesting public void updateAcceptLanguages() { synchronized (mAwSettingsLock) { - mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { - @Override - public void run() { - if (mNativeAwSettings != 0) { - nativeUpdateRendererPreferencesLocked(mNativeAwSettings); - } + mEventHandler.runOnUiThreadBlockingAndLocked(() -> { + if (mNativeAwSettings != 0) { + nativeUpdateRendererPreferencesLocked(mNativeAwSettings); } }); }
diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java index 549caaf..fdaafe5 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java +++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
@@ -297,12 +297,9 @@ if (fullscreenView == null) { return; } - WebChromeClient.CustomViewCallback cb = new WebChromeClient.CustomViewCallback() { - @Override - public void onCustomViewHidden() { - if (mCustomView != null) { - mAwContents.requestExitFullscreen(); - } + WebChromeClient.CustomViewCallback cb = () -> { + if (mCustomView != null) { + mAwContents.requestExitFullscreen(); } }; mCustomView = new FrameLayout(mContext);
diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java index 50edaf6..56fdde8 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java +++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java
@@ -112,21 +112,18 @@ // Only invoke the onPageCommitVisible callback when navigating to a different document, // but not when navigating to a different fragment within the same document. if (!isSameDocument) { - ThreadUtils.postOnUiThread(new Runnable() { - @Override - public void run() { - AwContents awContents = mAwContents.get(); - if (awContents != null) { - awContents.insertVisualStateCallbackIfNotDestroyed( - 0, new VisualStateCallback() { - @Override - public void onComplete(long requestId) { - AwContentsClient client = mAwContentsClient.get(); - if (client == null) return; - client.onPageCommitVisible(url); - } - }); - } + ThreadUtils.postOnUiThread(() -> { + AwContents awContents = mAwContents.get(); + if (awContents != null) { + awContents.insertVisualStateCallbackIfNotDestroyed( + 0, new VisualStateCallback() { + @Override + public void onComplete(long requestId) { + AwContentsClient client1 = mAwContentsClient.get(); + if (client1 == null) return; + client1.onPageCommitVisible(url); + } + }); } }); }
diff --git a/android_webview/java/src/org/chromium/android_webview/DefaultVideoPosterRequestHandler.java b/android_webview/java/src/org/chromium/android_webview/DefaultVideoPosterRequestHandler.java index aaed9f8e..8026da6 100644 --- a/android_webview/java/src/org/chromium/android_webview/DefaultVideoPosterRequestHandler.java +++ b/android_webview/java/src/org/chromium/android_webview/DefaultVideoPosterRequestHandler.java
@@ -33,29 +33,23 @@ // Send the request to UI thread to callback to the client, and if it provides a // valid bitmap bounce on to the worker thread pool to compress it into the piped // input/output stream. - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - final Bitmap defaultVideoPoster = contentClient.getDefaultVideoPoster(); - if (defaultVideoPoster == null) { - closeOutputStream(outputStream); - return; - } - AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() { - @Override - public void run() { - try { - defaultVideoPoster.compress(Bitmap.CompressFormat.PNG, 100, - outputStream); - outputStream.flush(); - } catch (IOException e) { - Log.e(TAG, null, e); - } finally { - closeOutputStream(outputStream); - } - } - }); + ThreadUtils.runOnUiThread(() -> { + final Bitmap defaultVideoPoster = contentClient.getDefaultVideoPoster(); + if (defaultVideoPoster == null) { + closeOutputStream(outputStream); + return; } + AsyncTask.THREAD_POOL_EXECUTOR.execute(() -> { + try { + defaultVideoPoster.compress(Bitmap.CompressFormat.PNG, 100, + outputStream); + outputStream.flush(); + } catch (IOException e) { + Log.e(TAG, null, e); + } finally { + closeOutputStream(outputStream); + } + }); }); return inputStream; }
diff --git a/android_webview/java/src/org/chromium/android_webview/JsResultHandler.java b/android_webview/java/src/org/chromium/android_webview/JsResultHandler.java index 53c0657..c13ddba 100644 --- a/android_webview/java/src/org/chromium/android_webview/JsResultHandler.java +++ b/android_webview/java/src/org/chromium/android_webview/JsResultHandler.java
@@ -22,23 +22,17 @@ @Override public void confirm(final String promptResult) { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - if (mBridge != null) mBridge.confirmJsResult(mId, promptResult); - mBridge = null; - } + ThreadUtils.runOnUiThread(() -> { + if (mBridge != null) mBridge.confirmJsResult(mId, promptResult); + mBridge = null; }); } @Override public void cancel() { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - if (mBridge != null) mBridge.cancelJsResult(mId); - mBridge = null; - } + ThreadUtils.runOnUiThread(() -> { + if (mBridge != null) mBridge.cancelJsResult(mId); + mBridge = null; }); } }
diff --git a/android_webview/java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java b/android_webview/java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java index 72734d60..2359960 100644 --- a/android_webview/java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java +++ b/android_webview/java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java
@@ -152,12 +152,7 @@ mFocused = mContentViewCore.getContainerView().hasWindowFocus(); mParentPositionObserver = new ViewPositionObserver(mContentViewCore.getContainerView()); - mParentPositionListener = new PositionObserver.Listener() { - @Override - public void onPositionChanged(int x, int y) { - updateParentPosition(x, y); - } - }; + mParentPositionListener = (x, y) -> updateParentPosition(x, y); mGestureStateListener = new GestureStateListener() { @Override public void onScrollStarted(int scrollOffsetX, int scrollOffsetY) { @@ -394,12 +389,7 @@ mTemporarilyHidden = hidden; if (mTemporarilyHidden) { if (mTemporarilyHiddenExpiredRunnable == null) { - mTemporarilyHiddenExpiredRunnable = new Runnable() { - @Override - public void run() { - setTemporarilyHidden(false); - } - }; + mTemporarilyHiddenExpiredRunnable = () -> setTemporarilyHidden(false); } removeCallbacks(mTemporarilyHiddenExpiredRunnable); long now = SystemClock.uptimeMillis(); @@ -419,12 +409,7 @@ cancelFadeIn(); if (allowed) { if (mDeferredHandleFadeInRunnable == null) { - mDeferredHandleFadeInRunnable = new Runnable() { - @Override - public void run() { - beginFadeIn(); - } - }; + mDeferredHandleFadeInRunnable = () -> beginFadeIn(); } postOnAnimation(mDeferredHandleFadeInRunnable); } else { @@ -455,12 +440,9 @@ private void scheduleInvalidate() { if (mInvalidationRunnable == null) { - mInvalidationRunnable = new Runnable() { - @Override - public void run() { - mHasPendingInvalidate = false; - doInvalidate(); - } + mInvalidationRunnable = () -> { + mHasPendingInvalidate = false; + doInvalidate(); }; }
diff --git a/android_webview/java/src/org/chromium/android_webview/crash/AwMinidumpUploaderDelegate.java b/android_webview/java/src/org/chromium/android_webview/crash/AwMinidumpUploaderDelegate.java index dcc409d8b..5e3972cd 100644 --- a/android_webview/java/src/org/chromium/android_webview/crash/AwMinidumpUploaderDelegate.java +++ b/android_webview/java/src/org/chromium/android_webview/crash/AwMinidumpUploaderDelegate.java
@@ -6,7 +6,6 @@ import android.content.Context; import android.net.ConnectivityManager; -import android.webkit.ValueCallback; import org.chromium.android_webview.PlatformServiceBridge; import org.chromium.android_webview.command_line.CommandLineUtil; @@ -77,12 +76,10 @@ @Override public void prepareToUploadMinidumps(final Runnable startUploads) { - PlatformServiceBridge.getInstance().queryMetricsSetting(new ValueCallback<Boolean>() { - public void onReceiveValue(Boolean enabled) { - ThreadUtils.assertOnUiThread(); - mPermittedByUser = enabled; - startUploads.run(); - } + PlatformServiceBridge.getInstance().queryMetricsSetting(enabled -> { + ThreadUtils.assertOnUiThread(); + mPermittedByUser = enabled; + startUploads.run(); }); }
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/crash/VisualStateCallbackTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/crash/VisualStateCallbackTest.java index b63c4ed4..3196225 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/crash/VisualStateCallbackTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/crash/VisualStateCallbackTest.java
@@ -89,12 +89,7 @@ public void doInvokeVisualStateCallbackOnUiThread() { final VisualStateCallbackTestAwContents awContents = this; - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - awContents.doInvokeVisualStateCallback(); - } - }); + ThreadUtils.runOnUiThread(() -> awContents.doInvokeVisualStateCallback()); } private void doInvokeVisualStateCallback() { @@ -156,12 +151,8 @@ @SkipCommandLineParameterization public void testAddVisualStateCallbackAfterRendererGone() throws Throwable { final VisualStateCallbackImpl vsImpl = new VisualStateCallbackImpl(); - mHelper.setOnRenderProcessGoneTask(new Runnable() { - @Override - public void run() { - mAwContents.insertVisualStateCallback(vsImpl.requestId(), vsImpl); - } - }); + mHelper.setOnRenderProcessGoneTask( + () -> mAwContents.insertVisualStateCallback(vsImpl.requestId(), vsImpl)); loadUrlAsync(mAwContents, "chrome://kill"); mHelper.waitForRenderProcessGoneNotifiedToAwContentsClient();
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/util/AwQuotaManagerBridgeTestUtil.java b/android_webview/javatests/src/org/chromium/android_webview/test/util/AwQuotaManagerBridgeTestUtil.java index 01abfbf7..a121097 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/util/AwQuotaManagerBridgeTestUtil.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/util/AwQuotaManagerBridgeTestUtil.java
@@ -4,14 +4,10 @@ package org.chromium.android_webview.test.util; -import android.webkit.ValueCallback; - import org.chromium.android_webview.AwQuotaManagerBridge; import org.chromium.android_webview.test.AwTestBase; import org.chromium.base.test.util.CallbackHelper; -import java.util.concurrent.Callable; - /** * This class provides common methods for AwQuotaManagerBridge related tests */ @@ -19,12 +15,7 @@ public static AwQuotaManagerBridge getQuotaManagerBridge(AwTestBase awTestBase) throws Exception { - return awTestBase.runTestOnUiThreadAndGetResult(new Callable<AwQuotaManagerBridge>() { - @Override - public AwQuotaManagerBridge call() throws Exception { - return AwQuotaManagerBridge.getInstance(); - } - }); + return awTestBase.runTestOnUiThreadAndGetResult(() -> AwQuotaManagerBridge.getInstance()); } private static class GetOriginsCallbackHelper extends CallbackHelper { @@ -47,18 +38,8 @@ final AwQuotaManagerBridge bridge = getQuotaManagerBridge(awTestBase); int callCount = callbackHelper.getCallCount(); - awTestBase.getInstrumentation().runOnMainSync(new Runnable() { - @Override - public void run() { - bridge.getOrigins( - new ValueCallback<AwQuotaManagerBridge.Origins>() { - @Override - public void onReceiveValue(AwQuotaManagerBridge.Origins origins) { - callbackHelper.notifyCalled(origins); - } - }); - } - }); + awTestBase.getInstrumentation().runOnMainSync(() -> bridge.getOrigins( + origins -> callbackHelper.notifyCalled(origins))); callbackHelper.waitForCallback(callCount); return callbackHelper.getOrigins();
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/util/AwTestTouchUtils.java b/android_webview/javatests/src/org/chromium/android_webview/test/util/AwTestTouchUtils.java index c733076..f33ef6c 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/util/AwTestTouchUtils.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/util/AwTestTouchUtils.java
@@ -60,13 +60,10 @@ */ public static void dragCompleteView(final View view, final int fromX, final int toX, final int fromY, final int toY, final int stepCount) { - view.post(new Runnable() { - @Override - public void run() { - long downTime = dragStart(view, fromX, fromY); - dragTo(view, fromX, toX, fromY, toY, stepCount, downTime); - dragEnd(view, toX, toY, downTime); - } + view.post(() -> { + long downTime = dragStart(view, fromX, fromY); + dragTo(view, fromX, toX, fromY, toY, stepCount, downTime); + dragEnd(view, toX, toY, downTime); }); } @@ -78,19 +75,16 @@ * @param view The view the coordinates are relative to. */ public static void simulateTouchCenterOfView(final View view) throws Throwable { - view.post(new Runnable() { - @Override - public void run() { - long eventTime = SystemClock.uptimeMillis(); - float x = (float) (view.getRight() - view.getLeft()) / 2; - float y = (float) (view.getBottom() - view.getTop()) / 2; - view.onTouchEvent(MotionEvent.obtain( - eventTime, eventTime, MotionEvent.ACTION_DOWN, - x, y, 0)); - view.onTouchEvent(MotionEvent.obtain( - eventTime, eventTime, MotionEvent.ACTION_UP, - x, y, 0)); - } + view.post(() -> { + long eventTime = SystemClock.uptimeMillis(); + float x = (float) (view.getRight() - view.getLeft()) / 2; + float y = (float) (view.getBottom() - view.getTop()) / 2; + view.onTouchEvent(MotionEvent.obtain( + eventTime, eventTime, MotionEvent.ACTION_DOWN, + x, y, 0)); + view.onTouchEvent(MotionEvent.obtain( + eventTime, eventTime, MotionEvent.ACTION_UP, + x, y, 0)); }); } }
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/util/CookieUtils.java b/android_webview/javatests/src/org/chromium/android_webview/test/util/CookieUtils.java index 53be08e..824e0cd2 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/util/CookieUtils.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/util/CookieUtils.java
@@ -72,12 +72,7 @@ final TestValueCallback<Boolean> callback = new TestValueCallback<Boolean>(); int callCount = callback.getOnReceiveValueHelper().getCallCount(); - awTestBase.runTestOnUiThread(new Runnable() { - @Override - public void run() { - cookieManager.removeAllCookies(callback); - } - }); + awTestBase.runTestOnUiThread(() -> cookieManager.removeAllCookies(callback)); callback.getOnReceiveValueHelper().waitForCallback(callCount); Assert.assertFalse(cookieManager.hasCookies()); }
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/util/GraphicsTestUtils.java b/android_webview/javatests/src/org/chromium/android_webview/test/util/GraphicsTestUtils.java index b27c7663..4ecb496 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/util/GraphicsTestUtils.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/util/GraphicsTestUtils.java
@@ -13,8 +13,6 @@ import org.chromium.android_webview.test.AwTestContainerView; import org.chromium.base.ThreadUtils; -import java.util.concurrent.Callable; - /** * Graphics-related test utils. */ @@ -32,12 +30,8 @@ public static Bitmap drawAwContentsOnUiThread( final AwContents awContents, final int width, final int height) { - return ThreadUtils.runOnUiThreadBlockingNoException(new Callable<Bitmap>() { - @Override - public Bitmap call() { - return drawAwContents(awContents, width, height); - } - }); + return ThreadUtils.runOnUiThreadBlockingNoException( + () -> drawAwContents(awContents, width, height)); } /** @@ -71,35 +65,23 @@ public static int sampleBackgroundColorOnUiThread(final AwContents awContents) throws Exception { - return ThreadUtils.runOnUiThreadBlocking(new Callable<Integer>() { - @Override - public Integer call() throws Exception { - return drawAwContents(awContents, 10, 10, 0, 0).getPixel(0, 0); - } - }); + return ThreadUtils.runOnUiThreadBlocking( + () -> drawAwContents(awContents, 10, 10, 0, 0).getPixel(0, 0)); } // Gets the pixel color at the center of AwContents. public static int getPixelColorAtCenterOfView( final AwContents awContents, final AwTestContainerView testContainerView) { - return ThreadUtils.runOnUiThreadBlockingNoException(new Callable<Integer>() { - @Override - public Integer call() { - return drawAwContents(awContents, 2, 2, -(float) testContainerView.getWidth() / 2, + return ThreadUtils.runOnUiThreadBlockingNoException( + () -> drawAwContents(awContents, 2, 2, -(float) testContainerView.getWidth() / 2, -(float) testContainerView.getHeight() / 2) - .getPixel(0, 0); - } - }); + .getPixel(0, 0)); } public static void pollForBackgroundColor(final AwContents awContents, final int c) throws Throwable { - AwTestBase.pollInstrumentationThread(new Callable<Boolean>() { - @Override - public Boolean call() throws Exception { - return sampleBackgroundColorOnUiThread(awContents) == c; - } - }); + AwTestBase.pollInstrumentationThread( + () -> sampleBackgroundColorOnUiThread(awContents) == c); } private static Bitmap doDrawAwContents(
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java b/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java index 4f35e75..1a24810 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java
@@ -13,7 +13,8 @@ import org.chromium.android_webview.AwContents; import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; -import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper; +import org.chromium.content.browser.test.util.TestCallbackHelperContainer + .OnEvaluateJavaScriptResultHelper; /** * Collection of functions for JavaScript-based interactions with a page. @@ -42,29 +43,21 @@ } }, WAIT_TIMEOUT_MS, CHECK_INTERVAL); - instrumentation.runOnMainSync(new Runnable() { - @Override - public void run() { - awContents.getWebContents().evaluateJavaScriptForTests( + instrumentation.runOnMainSync( + () -> awContents.getWebContents().evaluateJavaScriptForTests( "var evObj = new MouseEvent('click', {bubbles: true});" + "document.getElementById('" + linkId + "').dispatchEvent(evObj);" + "console.log('element with id [" + linkId + "] clicked');", - null); - } - }); + null)); } public static String executeJavaScriptAndWaitForResult(Instrumentation instrumentation, final AwContents awContents, final OnEvaluateJavaScriptResultHelper onEvaluateJavaScriptResultHelper, final String code) throws Exception { - instrumentation.runOnMainSync(new Runnable() { - @Override - public void run() { - onEvaluateJavaScriptResultHelper.evaluateJavaScriptForTests( - awContents.getWebContents(), code); - } - }); + instrumentation.runOnMainSync( + () -> onEvaluateJavaScriptResultHelper.evaluateJavaScriptForTests( + awContents.getWebContents(), code)); onEvaluateJavaScriptResultHelper.waitUntilHasValue(); Assert.assertTrue("Failed to retrieve JavaScript evaluation results.", onEvaluateJavaScriptResultHelper.hasValue());
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/util/VideoSurfaceViewUtils.java b/android_webview/javatests/src/org/chromium/android_webview/test/util/VideoSurfaceViewUtils.java index 8ce3724..4cebe28 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/util/VideoSurfaceViewUtils.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/util/VideoSurfaceViewUtils.java
@@ -10,8 +10,6 @@ import org.chromium.android_webview.test.AwTestBase; import org.chromium.content.browser.ContentVideoView; -import java.util.concurrent.Callable; - /** * Utils for testing SurfaceViews (SurfaceViews that display video). */ @@ -32,12 +30,8 @@ private static int containsNumChildrenOfType(final AwTestBase test, final View view, final Class<? extends View> childType) throws Exception { - return test.runTestOnUiThreadAndGetResult(new Callable<Integer>() { - @Override - public Integer call() throws Exception { - return containsNumChildrenOfTypeOnUiThread(view, childType); - } - }); + return test.runTestOnUiThreadAndGetResult( + () -> containsNumChildrenOfTypeOnUiThread(view, childType)); } private static int containsNumChildrenOfTypeOnUiThread(final View view,
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/util/VideoTestUtil.java b/android_webview/javatests/src/org/chromium/android_webview/test/util/VideoTestUtil.java index 2d9a9938..696edc2c 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/util/VideoTestUtil.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/util/VideoTestUtil.java
@@ -26,14 +26,11 @@ TestAwContentsClient client = new TestAwContentsClient(); final AwContents awContents = testCase.createAwTestContainerViewOnMainSync(client).getAwContents(); - testCase.getInstrumentation().runOnMainSync(new Runnable() { - @Override - public void run() { - AwSettings awSettings = awContents.getSettings(); - awSettings.setJavaScriptEnabled(true); - awSettings.setMediaPlaybackRequiresUserGesture(requiredUserGesture); - observer.register(awContents.getContentViewCore(), "javaObserver"); - } + testCase.getInstrumentation().runOnMainSync(() -> { + AwSettings awSettings = awContents.getSettings(); + awSettings.setJavaScriptEnabled(true); + awSettings.setMediaPlaybackRequiresUserGesture(requiredUserGesture); + observer.register(awContents.getContentViewCore(), "javaObserver"); }); VideoTestWebServer webServer = new VideoTestWebServer(); try {
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java index b9f781fb..5ae5d785 100644 --- a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java +++ b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
@@ -13,8 +13,6 @@ import android.view.Gravity; import android.view.KeyEvent; import android.view.View; -import android.view.View.OnClickListener; -import android.view.View.OnFocusChangeListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.WindowManager; @@ -26,8 +24,6 @@ import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.LinearLayout; -import android.widget.TextView; -import android.widget.TextView.OnEditorActionListener; import org.chromium.android_webview.AwBrowserContext; import org.chromium.android_webview.AwBrowserProcess; @@ -213,64 +209,52 @@ private void initializeUrlField() { mUrlTextView = (EditText) findViewById(R.id.url); - mUrlTextView.setOnEditorActionListener(new OnEditorActionListener() { - @Override - public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { - if ((actionId != EditorInfo.IME_ACTION_GO) && (event == null - || event.getKeyCode() != KeyEvent.KEYCODE_ENTER - || event.getAction() != KeyEvent.ACTION_DOWN)) { - return false; - } - - String url = mUrlTextView.getText().toString(); - try { - URI uri = new URI(url); - if (uri.getScheme() == null) { - url = "http://" + uri.toString(); - } else { - url = uri.toString(); - } - } catch (URISyntaxException e) { - // Ignore syntax errors. - } - mAwTestContainerView.getAwContents().loadUrl(url); - mUrlTextView.clearFocus(); - setKeyboardVisibilityForUrl(false); - mAwTestContainerView.requestFocus(); - return true; + mUrlTextView.setOnEditorActionListener((v, actionId, event) -> { + if ((actionId != EditorInfo.IME_ACTION_GO) && (event == null + || event.getKeyCode() != KeyEvent.KEYCODE_ENTER + || event.getAction() != KeyEvent.ACTION_DOWN)) { + return false; } - }); - mUrlTextView.setOnFocusChangeListener(new OnFocusChangeListener() { - @Override - public void onFocusChange(View v, boolean hasFocus) { - setKeyboardVisibilityForUrl(hasFocus); - mNextButton.setVisibility(hasFocus ? View.GONE : View.VISIBLE); - mPrevButton.setVisibility(hasFocus ? View.GONE : View.VISIBLE); - if (!hasFocus) { - mUrlTextView.setText(mWebContents.getVisibleUrl()); + + String url = mUrlTextView.getText().toString(); + try { + URI uri = new URI(url); + if (uri.getScheme() == null) { + url = "http://" + uri.toString(); + } else { + url = uri.toString(); } + } catch (URISyntaxException e) { + // Ignore syntax errors. + } + mAwTestContainerView.getAwContents().loadUrl(url); + mUrlTextView.clearFocus(); + setKeyboardVisibilityForUrl(false); + mAwTestContainerView.requestFocus(); + return true; + }); + mUrlTextView.setOnFocusChangeListener((v, hasFocus) -> { + setKeyboardVisibilityForUrl(hasFocus); + mNextButton.setVisibility(hasFocus ? View.GONE : View.VISIBLE); + mPrevButton.setVisibility(hasFocus ? View.GONE : View.VISIBLE); + if (!hasFocus) { + mUrlTextView.setText(mWebContents.getVisibleUrl()); } }); } private void initializeNavigationButtons() { mPrevButton = (ImageButton) findViewById(R.id.prev); - mPrevButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - if (mNavigationController.canGoBack()) { - mNavigationController.goBack(); - } + mPrevButton.setOnClickListener(v -> { + if (mNavigationController.canGoBack()) { + mNavigationController.goBack(); } }); mNextButton = (ImageButton) findViewById(R.id.next); - mNextButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - if (mNavigationController.canGoForward()) { - mNavigationController.goForward(); - } + mNextButton.setOnClickListener(v -> { + if (mNavigationController.canGoForward()) { + mNavigationController.goForward(); } }); }
diff --git a/ash/system/palette/palette_tray_unittest.cc b/ash/system/palette/palette_tray_unittest.cc index ec6b4786..24ac240 100644 --- a/ash/system/palette/palette_tray_unittest.cc +++ b/ash/system/palette/palette_tray_unittest.cc
@@ -194,18 +194,19 @@ HighlighterController highlighter_controller; HighlighterControllerTestApi highlighter_test_api(&highlighter_controller); test_palette_delegate()->set_highlighter_test_api(&highlighter_test_api); - GetEventGenerator().EnterPenPointerMode(); + ui::test::EventGenerator& generator = GetEventGenerator(); + generator.EnterPenPointerMode(); test_palette_delegate()->SetMetalayerSupported(true); // Press/drag does not activate the highlighter unless the palette tool is // activated. - GetEventGenerator().MoveTouch(gfx::Point(1, 1)); - GetEventGenerator().PressTouch(); + generator.MoveTouch(gfx::Point(1, 1)); + generator.PressTouch(); EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); - GetEventGenerator().MoveTouch(gfx::Point(2, 2)); + generator.MoveTouch(gfx::Point(2, 2)); EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); - GetEventGenerator().ReleaseTouch(); + generator.ReleaseTouch(); // Activate the palette tool, still no highlighter. test_api_->GetPaletteToolManager()->ActivateTool(PaletteToolId::METALAYER); @@ -214,10 +215,10 @@ // Press over a regular (non-palette) location. This should activate the // highlighter. EXPECT_FALSE(palette_utils::PaletteContainsPointInScreen(gfx::Point(1, 1))); - GetEventGenerator().MoveTouch(gfx::Point(1, 1)); - GetEventGenerator().PressTouch(); + generator.MoveTouch(gfx::Point(1, 1)); + generator.PressTouch(); EXPECT_TRUE(highlighter_test_api.IsShowingHighlighter()); - GetEventGenerator().ReleaseTouch(); + generator.ReleaseTouch(); // Disable/enable the palette tool to hide the highlighter. test_api_->GetPaletteToolManager()->DeactivateTool(PaletteToolId::METALAYER); @@ -228,14 +229,14 @@ // highlighter. gfx::Point palette_point = palette_tray_->GetBoundsInScreen().CenterPoint(); EXPECT_TRUE(palette_utils::PaletteContainsPointInScreen(palette_point)); - GetEventGenerator().MoveTouch(palette_point); - GetEventGenerator().PressTouch(); + generator.MoveTouch(palette_point); + generator.PressTouch(); EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); palette_point += gfx::Vector2d(1, 1); EXPECT_TRUE(palette_utils::PaletteContainsPointInScreen(palette_point)); - GetEventGenerator().MoveTouch(palette_point); + generator.MoveTouch(palette_point); EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); - GetEventGenerator().ReleaseTouch(); + generator.ReleaseTouch(); // The previous gesture should have disabled the palette tool. EXPECT_FALSE(test_api_->GetPaletteToolManager()->IsToolActive( @@ -250,12 +251,107 @@ // With the metalayer disabled again, press/drag does not activate the // highlighter. - GetEventGenerator().MoveTouch(gfx::Point(1, 1)); - GetEventGenerator().PressTouch(); + generator.MoveTouch(gfx::Point(1, 1)); + generator.PressTouch(); EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); - GetEventGenerator().MoveTouch(gfx::Point(2, 2)); + generator.MoveTouch(gfx::Point(2, 2)); EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); - GetEventGenerator().ReleaseTouch(); + generator.ReleaseTouch(); + + test_palette_delegate()->set_highlighter_test_api(nullptr); +} + +TEST_F(PaletteTrayTest, StylusBarrelButtonActivatesHighlighter) { + HighlighterController highlighter_controller; + HighlighterControllerTestApi highlighter_test_api(&highlighter_controller); + test_palette_delegate()->set_highlighter_test_api(&highlighter_test_api); + ui::test::EventGenerator& generator = GetEventGenerator(); + generator.EnterPenPointerMode(); + + // Press and drag while holding down the stylus button, no highlighter + // unless the metalayer support is enabled. + generator.set_flags(ui::EF_LEFT_MOUSE_BUTTON); + generator.PressTouch(); + EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); + generator.MoveTouch(gfx::Point(2, 2)); + EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); + generator.set_flags(ui::EF_NONE); + generator.MoveTouch(gfx::Point(3, 3)); + EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); + generator.ReleaseTouch(); + + // Now enable the metalayer support. + test_palette_delegate()->SetMetalayerSupported(true); + + // Press and drag with no button, still no highlighter. + generator.MoveTouch(gfx::Point(1, 1)); + generator.PressTouch(); + EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); + generator.MoveTouch(gfx::Point(2, 2)); + EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); + generator.ReleaseTouch(); + + // Press/drag with while holding down the stylus button, but over the palette + // tray. This should activate neither the palette tool nor the highlighter. + gfx::Point palette_point = palette_tray_->GetBoundsInScreen().CenterPoint(); + EXPECT_TRUE(palette_utils::PaletteContainsPointInScreen(palette_point)); + generator.MoveTouch(palette_point); + generator.PressTouch(); + EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); + palette_point += gfx::Vector2d(1, 1); + EXPECT_TRUE(palette_utils::PaletteContainsPointInScreen(palette_point)); + generator.MoveTouch(palette_point); + EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); + generator.ReleaseTouch(); + EXPECT_FALSE(test_api_->GetPaletteToolManager()->IsToolActive( + PaletteToolId::METALAYER)); + + // Press/drag while holding down the stylus button over a regular location. + // This should activate the palette tool and the highlighter. + EXPECT_FALSE(palette_utils::PaletteContainsPointInScreen(gfx::Point(1, 1))); + generator.MoveTouch(gfx::Point(1, 1)); + generator.set_flags(ui::EF_LEFT_MOUSE_BUTTON); + generator.PressTouch(); + // The press should enable the palette tool but not the highlighter. + EXPECT_TRUE(test_api_->GetPaletteToolManager()->IsToolActive( + PaletteToolId::METALAYER)); + EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); + generator.set_flags(ui::EF_NONE); + // The first move should create the the highlighter. + generator.MoveTouch(gfx::Point(2, 2)); + EXPECT_TRUE(highlighter_test_api.IsShowingHighlighter()); + generator.ReleaseTouch(); + + // Repeat the previous step, make sure that the palette tool is not toggled + // this time. + generator.MoveTouch(gfx::Point(1, 1)); + generator.set_flags(ui::EF_LEFT_MOUSE_BUTTON); + generator.PressTouch(); + generator.set_flags(ui::EF_NONE); + generator.MoveTouch(gfx::Point(2, 2)); + EXPECT_TRUE(test_api_->GetPaletteToolManager()->IsToolActive( + PaletteToolId::METALAYER)); + EXPECT_TRUE(highlighter_test_api.IsShowingHighlighter()); + generator.ReleaseTouch(); + + // Disable the metalayer support. + // This should deactivate both the palette tool and the highlighter. + test_palette_delegate()->SetMetalayerSupported(false); + EXPECT_FALSE(test_api_->GetPaletteToolManager()->IsToolActive( + PaletteToolId::METALAYER)); + EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); + + // Press/drag with the stylus button down should activate neither the palette + // tool nor the highlighter. + generator.MoveTouch(gfx::Point(1, 1)); + generator.set_flags(ui::EF_LEFT_MOUSE_BUTTON); + generator.PressTouch(); + generator.set_flags(ui::EF_NONE); + generator.MoveTouch(gfx::Point(2, 2)); + EXPECT_FALSE(test_api_->GetPaletteToolManager()->IsToolActive( + PaletteToolId::METALAYER)); + EXPECT_FALSE(highlighter_test_api.IsShowingHighlighter()); + generator.ReleaseTouch(); test_palette_delegate()->set_highlighter_test_api(nullptr); }
diff --git a/ash/system/web_notification/web_notification_tray_unittest.cc b/ash/system/web_notification/web_notification_tray_unittest.cc index 6f9ed0731..49110fb1 100644 --- a/ash/system/web_notification/web_notification_tray_unittest.cc +++ b/ash/system/web_notification/web_notification_tray_unittest.cc
@@ -213,8 +213,7 @@ using message_center::NotificationList; -// Flakily fails. http://crbug.com/229791 -TEST_F(WebNotificationTrayTest, DISABLED_ManyMessageCenterNotifications) { +TEST_F(WebNotificationTrayTest, ManyMessageCenterNotifications) { // Add the max visible notifications +1, ensure the correct visible number. size_t notifications_to_add = message_center::kMaxVisibleMessageCenterNotifications + 1; @@ -232,8 +231,7 @@ GetTray()->GetMessageCenterBubbleForTest()->NumMessageViewsForTest()); } -// Flakily times out. http://crbug.com/229792 -TEST_F(WebNotificationTrayTest, DISABLED_ManyPopupNotifications) { +TEST_F(WebNotificationTrayTest, ManyPopupNotifications) { // Add the max visible popup notifications +1, ensure the correct num visible. size_t notifications_to_add = message_center::kMaxVisiblePopupNotifications + 1;
diff --git a/ash/wm/overview/overview_window_drag_controller.cc b/ash/wm/overview/overview_window_drag_controller.cc index 8dff81d..da677bb 100644 --- a/ash/wm/overview/overview_window_drag_controller.cc +++ b/ash/wm/overview/overview_window_drag_controller.cc
@@ -60,7 +60,7 @@ item_->SetBounds(bounds, OverviewAnimationType::OVERVIEW_ANIMATION_NONE); previous_event_location_ = location_in_screen; - UpdatePhantomWindow(location_in_screen); + UpdatePhantomWindowAndWindowGrid(location_in_screen); } void OverviewWindowDragController::CompleteDrag() { @@ -90,10 +90,20 @@ } } -void OverviewWindowDragController::UpdatePhantomWindow( +void OverviewWindowDragController::UpdatePhantomWindowAndWindowGrid( const gfx::Point& location_in_screen) { SplitViewController::SnapPosition last_snap_position = snap_position_; snap_position_ = GetSnapPosition(location_in_screen); + + // If there is no current snapped window, update the window grid size if the + // dragged window can be snapped if dropped. + if (split_view_controller_->state() == SplitViewController::NO_SNAP && + snap_position_ != last_snap_position) { + // Do not reposition the item that is currently being dragged. + window_selector_->SetBoundsForWindowGridsInScreenIgnoringWindow( + GetGridBounds(snap_position_), item_); + } + if (snap_position_ == SplitViewController::NONE || snap_position_ != last_snap_position) { phantom_window_controller_.reset(); @@ -135,6 +145,25 @@ return SplitViewController::NONE; } +gfx::Rect OverviewWindowDragController::GetGridBounds( + SplitViewController::SnapPosition snap_position) { + aura::Window* pending_snapped_window = item_->GetWindow(); + switch (snap_position) { + case SplitViewController::NONE: + return gfx::Rect(split_view_controller_->GetDisplayWorkAreaBoundsInParent( + pending_snapped_window)); + case SplitViewController::LEFT: + return split_view_controller_->GetSnappedWindowBoundsInScreen( + pending_snapped_window, SplitViewController::RIGHT); + case SplitViewController::RIGHT: + return split_view_controller_->GetSnappedWindowBoundsInScreen( + pending_snapped_window, SplitViewController::LEFT); + } + + NOTREACHED(); + return gfx::Rect(); +} + void OverviewWindowDragController::SnapWindow( SplitViewController::SnapPosition snap_position) { DCHECK_NE(snap_position, SplitViewController::NONE);
diff --git a/ash/wm/overview/overview_window_drag_controller.h b/ash/wm/overview/overview_window_drag_controller.h index c12fee4..89f8d94 100644 --- a/ash/wm/overview/overview_window_drag_controller.h +++ b/ash/wm/overview/overview_window_drag_controller.h
@@ -34,11 +34,15 @@ WindowSelectorItem* item() { return item_; } private: - void UpdatePhantomWindow(const gfx::Point& location_in_screen); + // Updates visuals for the user while dragging items around. + void UpdatePhantomWindowAndWindowGrid(const gfx::Point& location_in_screen); SplitViewController::SnapPosition GetSnapPosition( const gfx::Point& location_in_screen) const; + // Returns the expected window grid bounds based on |snap_position|. + gfx::Rect GetGridBounds(SplitViewController::SnapPosition snap_position); + void SnapWindow(SplitViewController::SnapPosition snap_position); WindowSelector* window_selector_;
diff --git a/ash/wm/overview/window_grid.cc b/ash/wm/overview/window_grid.cc index acb22d7..41acb9f 100644 --- a/ash/wm/overview/window_grid.cc +++ b/ash/wm/overview/window_grid.cc
@@ -320,7 +320,8 @@ prepared_for_overview_ = true; } -void WindowGrid::PositionWindows(bool animate) { +void WindowGrid::PositionWindows(bool animate, + WindowSelectorItem* ignored_item) { if (window_selector_->is_shut_down() || window_list_.empty()) return; DCHECK(shield_widget_.get()); @@ -432,11 +433,19 @@ std::min(kMaxHeight + 2 * kWindowMargin, height), &rects, &max_bottom, &min_right, &max_right); } - // Position the windows centering the left-aligned rows vertically. + // Position the windows centering the left-aligned rows vertically. Do not + // position |ignored_item| if it is not nullptr and matches a item in + // |window_list_|. gfx::Vector2d offset(0, (total_bounds.bottom() - max_bottom) / 2); - for (size_t i = 0; i < window_list_.size(); ++i) { + for (size_t i = 0, j = 0; i < window_list_.size(); ++i, ++j) { + if (ignored_item != nullptr && window_list_[i].get() == ignored_item) { + // Decrement the |rects| index so that after repositioning there will not + // be a gap where the ignored item was supposed to be. + --j; + continue; + } window_list_[i]->SetBounds( - rects[i] + offset, + rects[j] + offset, animate ? OverviewAnimationType::OVERVIEW_ANIMATION_LAY_OUT_SELECTOR_ITEMS : OverviewAnimationType::OVERVIEW_ANIMATION_NONE); @@ -564,6 +573,13 @@ PositionWindows(true /* animate */); } +void WindowGrid::SetBoundsAndUpdatePositionsIgnoringWindow( + const gfx::Rect& bounds, + WindowSelectorItem* ignored_item) { + bounds_ = bounds; + PositionWindows(true /* animate */, ignored_item); +} + void WindowGrid::OnWindowDestroying(aura::Window* window) { window_observer_.Remove(window); window_state_observer_.Remove(wm::GetWindowState(window));
diff --git a/ash/wm/overview/window_grid.h b/ash/wm/overview/window_grid.h index 7164cfd..88a4df2 100644 --- a/ash/wm/overview/window_grid.h +++ b/ash/wm/overview/window_grid.h
@@ -76,7 +76,10 @@ // row height which is equivalent assuming fixed height), balanced rows and // minimal wasted space. // Optionally animates the windows to their targets when |animate| is true. - void PositionWindows(bool animate); + // If |ignored_item| is not null and is an item in |window_list_|, that item + // is not positioned. This is for split screen. + void PositionWindows(bool animate, + WindowSelectorItem* ignored_item = nullptr); // Updates |selected_index_| according to the specified |direction| and calls // MoveSelectionWidget(). Returns |true| if the new selection index is out of @@ -106,6 +109,9 @@ // Sets bounds for the window grid and positions all windows in the grid. void SetBoundsAndUpdatePositions(const gfx::Rect& bounds_in_screen); + void SetBoundsAndUpdatePositionsIgnoringWindow( + const gfx::Rect& bounds, + WindowSelectorItem* ignored_item); // Returns true if the grid has no more windows. bool empty() const { return window_list_.empty(); }
diff --git a/ash/wm/overview/window_selector.cc b/ash/wm/overview/window_selector.cc index a38bd9e..dcd66afe 100644 --- a/ash/wm/overview/window_selector.cc +++ b/ash/wm/overview/window_selector.cc
@@ -474,6 +474,13 @@ grid->SetBoundsAndUpdatePositions(bounds); } +void WindowSelector::SetBoundsForWindowGridsInScreenIgnoringWindow( + const gfx::Rect& bounds, + WindowSelectorItem* ignored_item) { + for (std::unique_ptr<WindowGrid>& grid : grid_list_) + grid->SetBoundsAndUpdatePositionsIgnoringWindow(bounds, ignored_item); +} + void WindowSelector::RemoveWindowSelectorItem(WindowSelectorItem* item) { if (item->GetWindow()->HasObserver(this)) { item->GetWindow()->RemoveObserver(this); @@ -713,23 +720,8 @@ ResetFocusRestoreWindow(false); } - if (state == SplitViewController::LEFT_SNAPPED) { - aura::Window* snapped_window = - Shell::Get()->split_view_controller()->left_window(); - const gfx::Rect bounds_in_screen = - Shell::Get()->split_view_controller()->GetSnappedWindowBoundsInScreen( - snapped_window, SplitViewController::RIGHT); - SetBoundsForWindowGridsInScreen(bounds_in_screen); - } else if (state == SplitViewController::RIGHT_SNAPPED) { - aura::Window* snapped_window = - Shell::Get()->split_view_controller()->right_window(); - const gfx::Rect bounds_in_screen = - Shell::Get()->split_view_controller()->GetSnappedWindowBoundsInScreen( - snapped_window, SplitViewController::LEFT); - SetBoundsForWindowGridsInScreen(bounds_in_screen); - } else { - DCHECK(state == SplitViewController::BOTH_SNAPPED || - state == SplitViewController::NO_SNAP); + if (state == SplitViewController::BOTH_SNAPPED || + state == SplitViewController::NO_SNAP) { // If two windows were snapped to both sides of the screen, end overview // mode. If split view mode was ended (e.g., one of the snapped window was // closed or minimized / fullscreened / maximized), also end overview mode
diff --git a/ash/wm/overview/window_selector.h b/ash/wm/overview/window_selector.h index 8e99394..fae4971 100644 --- a/ash/wm/overview/window_selector.h +++ b/ash/wm/overview/window_selector.h
@@ -85,6 +85,9 @@ // Called to set bounds for window grids. Used for split view. void SetBoundsForWindowGridsInScreen(const gfx::Rect& bounds); + void SetBoundsForWindowGridsInScreenIgnoringWindow( + const gfx::Rect& bounds, + WindowSelectorItem* ignored_item); // Removes the window selector item from the overview window grid. void RemoveWindowSelectorItem(WindowSelectorItem* item);
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index 40c944aa..0ebf5d4e 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc
@@ -333,6 +333,21 @@ return window_selector()->text_filter_widget_.get(); } + gfx::Rect GetSplitViewLeftWindowBounds(aura::Window* window) { + return split_view_controller()->GetLeftWindowBoundsInScreen(window); + } + + gfx::Rect GetSplitViewRightWindowBounds(aura::Window* window) { + return split_view_controller()->GetRightWindowBoundsInScreen(window); + } + + gfx::Rect GetGridBounds() { + if (window_selector()) + return window_selector()->grid_list_[0]->bounds_; + + return gfx::Rect(); + } + private: aura::test::TestWindowDelegate delegate_; NonActivatableActivationDelegate non_activatable_activation_delegate_; @@ -1968,4 +1983,78 @@ EXPECT_FALSE(window_selector_controller()->IsSelecting()); } +// Verify the window grid size changes as expected when dragging items around in +// overview mode when split view is enabled. +TEST_F(WindowSelectorTest, WindowGridSizeWhileDraggingWithSplitView) { + // Enable split view, enter maximize mode, add some windows and enter overview + // mode. + base::CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kAshEnableTabletSplitView); + Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + + const gfx::Rect bounds(0, 0, 400, 400); + std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); + std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); + std::unique_ptr<aura::Window> window3(CreateWindow(bounds)); + + ToggleOverview(); + ASSERT_TRUE(window_selector_controller()->IsSelecting()); + + // Select window one and start the drag. + const int grid_index = 0; + const int window_width = + Shell::Get()->GetPrimaryRootWindow()->GetBoundsInScreen().width(); + WindowSelectorItem* selector_item = + GetWindowItemForWindow(grid_index, window1.get()); + gfx::Rect selector_item_bounds = selector_item->target_bounds(); + gfx::Point start_location(selector_item_bounds.CenterPoint()); + window_selector()->InitiateDrag(selector_item, start_location); + + // Verify that when dragged to the left, the window grid is located where the + // right window of split view mode should be. + const gfx::Point left(0, 0); + window_selector()->Drag(selector_item, left); + EXPECT_FALSE(split_view_controller()->IsSplitViewModeActive()); + EXPECT_EQ(SplitViewController::NO_SNAP, split_view_controller()->state()); + EXPECT_TRUE(split_view_controller()->left_window() == nullptr); + EXPECT_EQ(GetSplitViewRightWindowBounds(window1.get()), GetGridBounds()); + + // Verify that when dragged to the right, the window grid is located where the + // left window of split view mode should be. + const gfx::Point right(window_width, 0); + window_selector()->Drag(selector_item, right); + EXPECT_EQ(SplitViewController::NO_SNAP, split_view_controller()->state()); + EXPECT_TRUE(split_view_controller()->right_window() == nullptr); + EXPECT_EQ(GetSplitViewLeftWindowBounds(window1.get()), GetGridBounds()); + + // Verify that when dragged to the center, the window grid is has the + // dimensions of the work area. + const gfx::Point center(window_width / 2, 0); + window_selector()->Drag(selector_item, center); + EXPECT_EQ(SplitViewController::NO_SNAP, split_view_controller()->state()); + EXPECT_EQ( + split_view_controller()->GetDisplayWorkAreaBoundsInScreen(window1.get()), + GetGridBounds()); + + // Snap window1 to the left and initialize dragging for window2. + window_selector()->Drag(selector_item, left); + window_selector()->CompleteDrag(selector_item); + ASSERT_EQ(SplitViewController::LEFT_SNAPPED, + split_view_controller()->state()); + ASSERT_EQ(window1.get(), split_view_controller()->left_window()); + selector_item = GetWindowItemForWindow(grid_index, window2.get()); + selector_item_bounds = selector_item->target_bounds(); + start_location = selector_item_bounds.CenterPoint(); + window_selector()->InitiateDrag(selector_item, start_location); + + // Verify that when there is a snapped window, the window grid bounds remain + // constant despite window selector items being dragged left and right. + window_selector()->Drag(selector_item, left); + EXPECT_EQ(GetSplitViewRightWindowBounds(window1.get()), GetGridBounds()); + window_selector()->Drag(selector_item, right); + EXPECT_EQ(GetSplitViewRightWindowBounds(window1.get()), GetGridBounds()); + window_selector()->Drag(selector_item, center); + EXPECT_EQ(GetSplitViewRightWindowBounds(window1.get()), GetGridBounds()); +} + } // namespace ash
diff --git a/ash/wm/splitview/split_view_controller.h b/ash/wm/splitview/split_view_controller.h index 4696747..c151e39 100644 --- a/ash/wm/splitview/split_view_controller.h +++ b/ash/wm/splitview/split_view_controller.h
@@ -22,6 +22,7 @@ class SplitViewControllerTest; class SplitViewDivider; +class WindowSelectorTest; // The controller for the split view. It snaps a window to left/right side of // the screen. It also observes the two snapped windows and decides when to exit @@ -102,6 +103,7 @@ private: friend class SplitViewControllerTest; + friend class WindowSelectorTest; // Ends the split view mode. void EndSplitView();
diff --git a/ash/wm/workspace/backdrop_controller.cc b/ash/wm/workspace/backdrop_controller.cc index fbaec786..5b39987 100644 --- a/ash/wm/workspace/backdrop_controller.cc +++ b/ash/wm/workspace/backdrop_controller.cc
@@ -9,11 +9,13 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" #include "ash/system/tray/system_tray_notifier.h" +#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace/backdrop_delegate.h" #include "base/auto_reset.h" #include "base/memory/ptr_util.h" #include "chromeos/audio/chromeos_sounds.h" +#include "ui/app_list/app_list_features.h" #include "ui/aura/client/aura_constants.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" @@ -106,7 +108,7 @@ void BackdropController::UpdateBackdrop() { // Avoid recursive calls. - if (in_restacking_ || force_hidden_) + if (in_restacking_ || force_hidden_counter_) return; aura::Window* window = GetTopmostWindowWithBackdrop(); @@ -136,26 +138,39 @@ } void BackdropController::OnOverviewModeStarting() { - force_hidden_ = true; - Hide(); + AddForceHidden(); } void BackdropController::OnOverviewModeEnded() { - if (Shell::Get()->IsSplitViewModeActive()) - return; - - force_hidden_ = false; - UpdateBackdrop(); + RemoveForceHidden(); } void BackdropController::OnSplitViewModeStarting() { - force_hidden_ = true; - Hide(); + AddForceHidden(); } void BackdropController::OnSplitViewModeEnded() { - force_hidden_ = false; - UpdateBackdrop(); + RemoveForceHidden(); +} + +void BackdropController::OnAppListVisibilityChanged(bool shown, + aura::Window* root_window) { + // Ignore the notification if it is not for this display. + if (container_->GetRootWindow() != root_window) + return; + + // Hide or update backdrop only for fullscreen app list in tablet mode. + if (!app_list::features::IsFullscreenAppListEnabled() || + !Shell::Get() + ->tablet_mode_controller() + ->IsTabletModeWindowManagerEnabled()) { + return; + } + + if (shown) + AddForceHidden(); + else + RemoveForceHidden(); } void BackdropController::OnAccessibilityModeChanged( @@ -251,4 +266,22 @@ backdrop_event_handler_.reset(); } +void BackdropController::AddForceHidden() { + force_hidden_counter_++; + CHECK_GE(force_hidden_counter_, 0); + if (force_hidden_counter_) + Hide(); + else + UpdateBackdrop(); +} + +void BackdropController::RemoveForceHidden() { + force_hidden_counter_--; + CHECK_GE(force_hidden_counter_, 0); + if (force_hidden_counter_) + Hide(); + else + UpdateBackdrop(); +} + } // namespace ash
diff --git a/ash/wm/workspace/backdrop_controller.h b/ash/wm/workspace/backdrop_controller.h index 04313126..c2de431 100644 --- a/ash/wm/workspace/backdrop_controller.h +++ b/ash/wm/workspace/backdrop_controller.h
@@ -62,6 +62,8 @@ void OnOverviewModeEnded() override; void OnSplitViewModeStarting() override; void OnSplitViewModeEnded() override; + void OnAppListVisibilityChanged(bool shown, + aura::Window* root_window) override; // AccessibilityObserver: void OnAccessibilityModeChanged( @@ -85,6 +87,12 @@ // Hide the backdrop window. void Hide(); + // Increment |force_hidden_counter_| and then update backdrop state. + void AddForceHidden(); + + // Decrement |force_hidden_counter_| and then update backdrop state. + void RemoveForceHidden(); + // The backdrop which covers the rest of the screen. views::Widget* backdrop_ = nullptr; @@ -103,9 +111,9 @@ // If true, the |RestackOrHideWindow| might recurse. bool in_restacking_ = false; - // True to temporarily hide the backdrop. Used in - // overview mode. - bool force_hidden_ = false; + // Hide the backdrop if the counter is larger than 0. The counter is + // maintained by overview mode, split view and app list visibility state. + int force_hidden_counter_ = 0; DISALLOW_COPY_AND_ASSIGN(BackdropController); };
diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc index 2732349..db262e1 100644 --- a/ash/wm/workspace/workspace_layout_manager_unittest.cc +++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc
@@ -8,6 +8,7 @@ #include <utility> #include "ash/accessibility_delegate.h" +#include "ash/app_list/test_app_list_view_presenter_impl.h" #include "ash/frame/custom_frame_view_ash.h" #include "ash/public/cpp/app_types.h" #include "ash/public/cpp/config.h" @@ -28,6 +29,7 @@ #include "ash/wm/fullscreen_window_finder.h" #include "ash/wm/overview/window_selector_controller.h" #include "ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h" +#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" #include "ash/wm/wm_event.h" @@ -36,9 +38,12 @@ #include "ash/wm/workspace_controller_test_api.h" #include "base/command_line.h" #include "base/run_loop.h" +#include "base/test/scoped_feature_list.h" #include "chromeos/audio/chromeos_sounds.h" +#include "ui/app_list/app_list_features.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/focus_client.h" +#include "ui/aura/client/window_parenting_client.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/aura/window_targeter.h" @@ -975,17 +980,26 @@ } // Turn the top window back drop on / off. - void ShowTopWindowBackdrop(bool show) { + void ShowTopWindowBackdropForContainer(aura::Window* container, bool show) { std::unique_ptr<BackdropDelegate> backdrop; if (show) { backdrop = base::MakeUnique<TabletModeBackdropDelegateImpl>(); } - GetWorkspaceLayoutManager(default_container_) - ->SetBackdropDelegate(std::move(backdrop)); + GetWorkspaceLayoutManager(container)->SetBackdropDelegate( + std::move(backdrop)); // Closing and / or opening can be a delayed operation. base::RunLoop().RunUntilIdle(); } + aura::Window* CreateTestWindowInParent(aura::Window* root_window) { + aura::Window* window = new aura::Window(nullptr); + window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); + window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->Init(ui::LAYER_TEXTURED); + aura::client::ParentWindowWithContext(window, root_window, gfx::Rect()); + return window; + } + // Return the default container. aura::Window* default_container() { return default_container_; } @@ -1030,13 +1044,13 @@ // Check that creating the BackDrop without destroying it does not lead into // a crash. TEST_F(WorkspaceLayoutManagerBackdropTest, BackdropCrashTest) { - ShowTopWindowBackdrop(true); + ShowTopWindowBackdropForContainer(default_container(), true); } // Verify basic assumptions about the backdrop. TEST_F(WorkspaceLayoutManagerBackdropTest, BasicBackdropTests) { // The background widget will be created when there is a window. - ShowTopWindowBackdrop(true); + ShowTopWindowBackdropForContainer(default_container(), true); ASSERT_EQ(0u, default_container()->children().size()); { @@ -1057,7 +1071,7 @@ EXPECT_FALSE(default_container()->children()[0]->IsVisible()); // Destroying the Backdrop should empty the container. - ShowTopWindowBackdrop(false); + ShowTopWindowBackdropForContainer(default_container(), false); ASSERT_EQ(0U, default_container()->children().size()); } @@ -1087,7 +1101,7 @@ // Turn on the backdrop mode and check that the window shows up where it // should be (second highest number). - ShowTopWindowBackdrop(true); + ShowTopWindowBackdropForContainer(default_container(), true); backdrop = default_container()->children()[2]; EXPECT_EQ("C,X,B,A", GetWindowOrderAsString(backdrop, window1.get(), window2.get(), window3.get())); @@ -1109,7 +1123,7 @@ window3.reset(); EXPECT_EQ("b,x", GetWindowOrderAsString(backdrop, window1.get(), window2.get(), window3.get())); - ShowTopWindowBackdrop(false); + ShowTopWindowBackdropForContainer(default_container(), false); EXPECT_EQ("b", GetWindowOrderAsString(nullptr, window1.get(), window2.get(), window3.get())); } @@ -1119,7 +1133,7 @@ ShelfVisibilityDoesNotChangesBounds) { Shelf* shelf = GetPrimaryShelf(); ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); - ShowTopWindowBackdrop(true); + ShowTopWindowBackdropForContainer(default_container(), true); RunAllPendingInMessageLoop(); const gfx::Size fullscreen_size = display::Screen::GetScreen()->GetPrimaryDisplay().size(); @@ -1236,7 +1250,7 @@ // Enabling the backdrop delegate for tablet mode will put the // backdrop on the top most window. - ShowTopWindowBackdrop(true); + ShowTopWindowBackdropForContainer(default_container(), true); { aura::Window::Windows children = window1->parent()->children(); EXPECT_EQ(children[0], window1.get()); @@ -1261,7 +1275,7 @@ } // Removing the delegate will move the backdrop back to window1. - ShowTopWindowBackdrop(false); + ShowTopWindowBackdropForContainer(default_container(), false); { aura::Window::Windows children = window1->parent()->children(); EXPECT_EQ(children[0], backdrop); @@ -1330,6 +1344,119 @@ EXPECT_EQ(kNoSoundKey, accessibility_delegate->GetPlayedEarconAndReset()); } +TEST_F(WorkspaceLayoutManagerBackdropTest, + DualDisplayShowAppListWithBackdropState) { + // Create two displays. + UpdateDisplay("0+0-200x200,+200+0-100x100"); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + EXPECT_EQ(root_windows.size(), 2u); + + // Create a window in each display and show them in maximized state. + aura::Window* window_1 = CreateTestWindowInParent(root_windows[0]); + window_1->SetBounds(gfx::Rect(0, 0, 100, 100)); + window_1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); + window_1->Show(); + aura::Window* window_2 = CreateTestWindowInParent(root_windows[1]); + window_2->SetBounds(gfx::Rect(201, 0, 100, 100)); + window_2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); + window_2->Show(); + + RootWindowController* primary_controller = + Shell::GetPrimaryRootWindowController(); + WorkspaceController* primary_wc = primary_controller->workspace_controller(); + Shell::RootWindowControllerList controllers = + Shell::GetAllRootWindowControllers(); + WorkspaceController* secondary_wc = nullptr; + RootWindowController* secondary_controller = nullptr; + EXPECT_EQ(controllers.size(), 2u); + for (size_t i = 0; i < controllers.size(); ++i) { + if (controllers[i] != primary_controller) { + secondary_controller = controllers[i]; + secondary_wc = secondary_controller->workspace_controller(); + } + } + + // Turn on top window backdrop for two displays. + WorkspaceControllerTestApi primary_test_helper(primary_wc); + WorkspaceControllerTestApi secondary_test_helper(secondary_wc); + ShowTopWindowBackdropForContainer(default_container(), true); + EXPECT_TRUE(primary_test_helper.GetBackdropWindow()); + ShowTopWindowBackdropForContainer( + secondary_controller->GetContainer(kShellWindowId_DefaultContainer), + true); + EXPECT_TRUE(secondary_test_helper.GetBackdropWindow()); + + // Enable tablet mode and fullscreen app list. + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeature( + app_list::features::kEnableFullscreenAppList); + Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + EXPECT_TRUE(app_list::features::IsFullscreenAppListEnabled()); + EXPECT_TRUE(Shell::Get() + ->tablet_mode_controller() + ->IsTabletModeWindowManagerEnabled()); + + // Show app list in primary display will not hide the backdrop in secondary + // display. + EXPECT_TRUE(primary_test_helper.GetBackdropWindow()); + EXPECT_TRUE(secondary_test_helper.GetBackdropWindow()); + TestAppListViewPresenterImpl app_list_presenter_impl_; + app_list_presenter_impl_.Show( + display::Screen::GetScreen()->GetPrimaryDisplay().id()); + EXPECT_FALSE(primary_test_helper.GetBackdropWindow()); + EXPECT_TRUE(secondary_test_helper.GetBackdropWindow()); +} + +// Fullscreen app list changes to visible should hide the backdrop, otherwise, +// should show the backdrop. +TEST_F(WorkspaceLayoutManagerBackdropTest, + UpdateBackdropOnAppListVisibilityNotification) { + WorkspaceController* wc = ShellTestApi(Shell::Get()).workspace_controller(); + WorkspaceControllerTestApi test_helper(wc); + + std::unique_ptr<aura::Window> window( + CreateTestWindow(gfx::Rect(0, 0, 100, 100))); + EXPECT_FALSE(test_helper.GetBackdropWindow()); + + // Turn the top window backdrop on. + ShowTopWindowBackdropForContainer(default_container(), true); + EXPECT_TRUE(test_helper.GetBackdropWindow()); + EXPECT_FALSE(app_list::features::IsFullscreenAppListEnabled()); + + // Show the non-fullscreen app list should have no effect for the backdrop. + TestAppListViewPresenterImpl app_list_presenter_impl_; + app_list_presenter_impl_.Show( + display::Screen::GetScreen()->GetPrimaryDisplay().id()); + EXPECT_TRUE(test_helper.GetBackdropWindow()); + + // Tap shelf should dismiss the app list. + ui::test::EventGenerator& generator = GetEventGenerator(); + gfx::Rect work_area = + display::Screen::GetScreen()->GetPrimaryDisplay().work_area(); + gfx::Point shelf_point(work_area.CenterPoint().x(), work_area.bottom() + 5); + generator.GestureTapAt(shelf_point); + EXPECT_TRUE(test_helper.GetBackdropWindow()); + + // Enable tablet mode and fullscreen app list. + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeature( + app_list::features::kEnableFullscreenAppList); + Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + EXPECT_TRUE(test_helper.GetBackdropWindow()); + EXPECT_TRUE(app_list::features::IsFullscreenAppListEnabled()); + EXPECT_TRUE(Shell::Get() + ->tablet_mode_controller() + ->IsTabletModeWindowManagerEnabled()); + // Show the fullscreen app list should hide the backdrop. + app_list_presenter_impl_.Show( + display::Screen::GetScreen()->GetPrimaryDisplay().id()); + EXPECT_FALSE(test_helper.GetBackdropWindow()); + // Tap at shelf should dismiss the app list and backdrop should be shown + // again. + generator.GestureTapAt(shelf_point); + EXPECT_TRUE(test_helper.GetBackdropWindow()); +} + TEST_F(WorkspaceLayoutManagerBackdropTest, SpokenFeedbackForArc) { WorkspaceController* wc = ShellTestApi(Shell::Get()).workspace_controller(); WorkspaceControllerTestApi test_helper(wc);
diff --git a/base/debug/stack_trace_fuchsia.cc b/base/debug/stack_trace_fuchsia.cc index a94821e..8c3f428 100644 --- a/base/debug/stack_trace_fuchsia.cc +++ b/base/debug/stack_trace_fuchsia.cc
@@ -172,14 +172,14 @@ OutputToStream(&std::cerr); } -// Sample stack trace output: -// #00 0x1527a058aa00 app:/system/base_unittests+0x18bda00 -// #01 0x1527a0254b5c app:/system/base_unittests+0x1587b5c -// #02 0x15279f446ece app:/system/base_unittests+0x779ece +// Sample stack trace output is designed to be similar to Fuchsia's crashlogger: +// bt#00: pc 0x1527a058aa00 (app:/system/base_unittests,0x18bda00) +// bt#01: pc 0x1527a0254b5c (app:/system/base_unittests,0x1587b5c) +// bt#02: pc 0x15279f446ece (app:/system/base_unittests,0x779ece) // ... -// #21 0x1527a05b51b4 app:/system/base_unittests+0x18e81b4 -// #22 0x54fdbf3593de libc.so+0x1c3de -// #23 end +// bt#21: pc 0x1527a05b51b4 (app:/system/base_unittests,0x18e81b4) +// bt#22: pc 0x54fdbf3593de (libc.so,0x1c3de) +// bt#23: end void StackTrace::OutputToStream(std::ostream* os) const { SymbolMap map; @@ -189,19 +189,19 @@ if (entry) { size_t offset = reinterpret_cast<uintptr_t>(trace_[i]) - reinterpret_cast<uintptr_t>(entry->addr); - *os << "#" << std::setw(2) << std::setfill('0') << i << std::setw(0) - << " " << trace_[i] << " " << entry->name << "+0x" << std::hex - << offset << std::dec << std::setw(0) << "\n"; + *os << "bt#" << std::setw(2) << std::setfill('0') << i << std::setw(0) + << ": pc " << trace_[i] << " (" << entry->name << ",0x" << std::hex + << offset << std::dec << std::setw(0) << ")\n"; } else { // Fallback if the DSO map isn't available. // Logged PC values are absolute memory addresses, and the shared object // name is not emitted. - *os << "#" << std::setw(2) << std::setfill('0') << i << std::setw(0) - << trace_[i] << "\n"; + *os << "bt#" << std::setw(2) << std::setfill('0') << i << std::setw(0) + << ": pc " << trace_[i] << "\n"; } } - (*os) << "#" << std::setw(2) << i << " end\n"; + (*os) << "bt#" << std::setw(2) << i << ": end\n"; } } // namespace debug
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index c39b64e..01bb360 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni
@@ -1174,6 +1174,12 @@ _input_jar_path = invoker.input_jar_path _output_jar_path = invoker.output_jar_path + _enable_assert = + defined(invoker.supports_android) && invoker.supports_android && + (is_java_debug || dcheck_always_on) + + _desugar = defined(invoker.supports_android) && invoker.supports_android + _jar_excluded_patterns = [] if (defined(invoker.jar_excluded_patterns)) { _jar_excluded_patterns = invoker.jar_excluded_patterns @@ -1182,53 +1188,9 @@ invoker.strip_resource_classes _filter_jar = _jar_excluded_patterns != [] || _strip_resource_classes - _enable_assert = - defined(invoker.supports_android) && invoker.supports_android && - (is_java_debug || dcheck_always_on) - - _desugar = defined(invoker.supports_android) && invoker.supports_android - _deps = [] _previous_output_jar = _input_jar_path - if (_filter_jar) { - _filter_target = "${target_name}__filter" - _filter_input_jar = _previous_output_jar - _filter_output_jar = "$target_out_dir/$target_name-filtered.jar" - - action(_filter_target) { - script = "//build/android/gyp/jar.py" - deps = _deps - if (defined(invoker.deps)) { - deps += invoker.deps - } - if (defined(invoker.public_deps)) { - public_deps = invoker.public_deps - } - inputs = [ - _build_config, - _filter_input_jar, - ] - outputs = [ - _filter_output_jar, - ] - args = [ - "--input-jar", - rebase_path(_filter_input_jar, root_build_dir), - "--jar-path", - rebase_path(_filter_output_jar, root_build_dir), - "--excluded-classes=$_jar_excluded_patterns", - ] - if (_strip_resource_classes) { - args += [ "--strip-resource-classes-for=@FileArg($_rebased_build_config:javac:resource_packages)" ] - } - } - - _deps = [] - _deps = [ ":$_filter_target" ] - _previous_output_jar = _filter_output_jar - } - if (_enable_assert) { _assert_target = "${target_name}__assert" _assert_input_jar = _previous_output_jar @@ -1301,7 +1263,7 @@ rebase_path(_desugar_input_jar, root_build_dir), "--output-jar", rebase_path(_desugar_output_jar, root_build_dir), - "--classpath=@FileArg($_rebased_build_config:javac:classpath)", + "--classpath=@FileArg($_rebased_build_config:deps_info:java:full_classpath)", "--bootclasspath-entry", rebase_path(_android_sdk_ijar, root_build_dir), ] @@ -1311,6 +1273,44 @@ _deps = [ ":$_desugar_target" ] _previous_output_jar = _desugar_output_jar } + + if (_filter_jar) { + _filter_target = "${target_name}__filter" + _filter_input_jar = _previous_output_jar + _filter_output_jar = "$target_out_dir/$target_name-filtered.jar" + + action(_filter_target) { + script = "//build/android/gyp/jar.py" + deps = _deps + if (defined(invoker.deps)) { + deps += invoker.deps + } + if (defined(invoker.public_deps)) { + public_deps = invoker.public_deps + } + inputs = [ + _build_config, + _filter_input_jar, + ] + outputs = [ + _filter_output_jar, + ] + args = [ + "--input-jar", + rebase_path(_filter_input_jar, root_build_dir), + "--jar-path", + rebase_path(_filter_output_jar, root_build_dir), + "--excluded-classes=$_jar_excluded_patterns", + ] + if (_strip_resource_classes) { + args += [ "--strip-resource-classes-for=@FileArg($_rebased_build_config:javac:resource_packages)" ] + } + } + + _deps = [] + _deps = [ ":$_filter_target" ] + _previous_output_jar = _filter_output_jar + } _output_jar_target = "${target_name}__copy" copy(_output_jar_target) {
diff --git a/build/fuchsia/exe_runner.py b/build/fuchsia/exe_runner.py index 1eb0fb6..2c87b2a7 100755 --- a/build/fuchsia/exe_runner.py +++ b/build/fuchsia/exe_runner.py
@@ -40,7 +40,7 @@ if not bootfs: return 2 - return RunFuchsia(bootfs, args.exe_name, args.device, args.dry_run) + return RunFuchsia(bootfs, args.device, args.dry_run) if __name__ == '__main__':
diff --git a/build/fuchsia/runner_common.py b/build/fuchsia/runner_common.py index 686a0cd..8728a11 100755 --- a/build/fuchsia/runner_common.py +++ b/build/fuchsia/runner_common.py
@@ -91,24 +91,52 @@ return loc -def _AddToManifest(manifest_file, target_name, source, mapper): - """Appends |source| to the given |manifest_file| (a file object) in a format - suitable for consumption by mkbootfs. - - If |source| is a file it's directly added. If |source| is a directory, its - contents are recursively added. - - |source| must exist on disk at the time this function is called. +def _ExpandDirectories(file_mapping, mapper): + """Walks directories listed in |file_mapping| and adds their contents to + |file_mapping|, using |mapper| to determine the target filename. """ - if os.path.isdir(source): - files = [os.path.join(dp, f) for dp, dn, fn in os.walk(source) for f in fn] - for f in files: - # We pass None as the mapper because this should never recurse a 2nd time. - _AddToManifest(manifest_file, mapper(f), f, None) - elif os.path.exists(source): - manifest_file.write('%s=%s\n' % (target_name, source)) - else: - raise Exception('%s does not exist' % source) + expanded = {} + for target, source in file_mapping.items(): + if os.path.isdir(source): + files = [os.path.join(dir_path, filename) + for dir_path, dir_names, file_names in os.walk(source) + for filename in file_names] + for f in files: + expanded[mapper(f)] = f + elif os.path.exists(source): + expanded[target] = source + else: + raise Exception('%s does not exist' % source) + return expanded + + +def _StripBinary(dry_run, bin_path): + """Creates a stripped copy of the executable at |bin_path| and returns the + path to the stripped copy.""" + strip_path = tempfile.mktemp() + _RunAndCheck(dry_run, ['/usr/bin/strip', bin_path, '-o', strip_path]) + if not dry_run and not os.path.exists(strip_path): + raise Exception('strip did not create output file') + return strip_path + + +def _StripBinaries(dry_run, file_mapping): + """Strips all executables in |file_mapping|, and returns a new mapping + dictionary, suitable to pass to _WriteManifest()""" + new_mapping = file_mapping.copy() + for target, source in file_mapping.iteritems(): + with open(source, 'rb') as f: + file_tag = f.read(4) + if file_tag == '\x7fELF': + new_mapping[target] = _StripBinary(dry_run, source) + return new_mapping + + +def _WriteManifest(manifest_file, file_mapping): + """Writes |file_mapping| to the given |manifest_file| (a file object) in a + form suitable for consumption by mkbootfs.""" + for target, source in file_mapping.viewitems(): + manifest_file.write('%s=%s\n' % (target, source)) def ReadRuntimeDeps(deps_path, output_directory): @@ -120,24 +148,11 @@ result.append((target_path, abs_path)) return result -def _StripBinary(dry_run, bin_path): - strip_path = bin_path + '_stripped'; - shutil.copyfile(bin_path, strip_path) - _RunAndCheck(dry_run, ['/usr/bin/strip', strip_path]) - return strip_path - - def BuildBootfs(output_directory, runtime_deps, bin_name, child_args, device, dry_run): - target_source_pairs = runtime_deps - - # Stage the stripped binary in the boot image, keeping the original binary's - # name for symbolization purposes. - bin_path = os.path.abspath(os.path.join(output_directory, bin_name)) - stripped_bin_path = _StripBinary(dry_run, bin_path) - target_source_pairs.append( - (_MakeTargetImageName(DIR_SOURCE_ROOT, output_directory, bin_name), - stripped_bin_path)) + # |runtime_deps| already contains (target, source) pairs for the runtime deps, + # so we can initialize |file_mapping| from it directly. + file_mapping = dict(runtime_deps) # Generate a script that runs the binaries and shuts down QEMU (if used). autorun_file = tempfile.NamedTemporaryFile() @@ -163,20 +178,28 @@ autorun_file.flush() os.chmod(autorun_file.name, 0750) _DumpFile(dry_run, autorun_file.name, 'autorun') - target_source_pairs.append(('autorun', autorun_file.name)) + # Add the autorun file and target binary to |file_mapping|. + file_mapping['autorun'] = autorun_file.name + file_mapping[os.path.basename(bin_name)] = bin_name + + # Find the full list of files to add to the bootfs. + file_mapping = _ExpandDirectories( + file_mapping, + lambda x: _MakeTargetImageName(DIR_SOURCE_ROOT, output_directory, x)) + + # Strip any binaries in the file list, and generate a manifest mapping. + manifest_mapping = _StripBinaries(dry_run, file_mapping) + + # Write the target, source mappings to a file suitable for bootfs. manifest_file = tempfile.NamedTemporaryFile() - bootfs_name = bin_name + '.bootfs' - - for target, source in target_source_pairs: - _AddToManifest(manifest_file.file, target, source, - lambda x: _MakeTargetImageName( - DIR_SOURCE_ROOT, output_directory, x)) - - mkbootfs_path = os.path.join(SDK_ROOT, 'tools', 'mkbootfs') - + _WriteManifest(manifest_file.file, manifest_mapping) manifest_file.flush() _DumpFile(dry_run, manifest_file.name, 'manifest') + + # Run mkbootfs with the manifest to copy the necessary files into the bootfs. + mkbootfs_path = os.path.join(SDK_ROOT, 'tools', 'mkbootfs') + bootfs_name = bin_name + '.bootfs' if _RunAndCheck( dry_run, [mkbootfs_path, '-o', bootfs_name, @@ -184,23 +207,62 @@ '--target=system', manifest_file.name]) != 0: return None - return bootfs_name + # Return both the name of the bootfs file, and the filename mapping. + return (bootfs_name, file_mapping) def _SymbolizeEntry(entry): - addr2line_output = subprocess.check_output( - ['addr2line', '-Cipf', '--exe=' + entry[1], entry[2]]) - prefix = '#%s: ' % entry[0] - # addr2line outputs a second line for inlining information, offset - # that to align it properly after the frame index. - addr2line_filtered = addr2line_output.strip().replace( - '(inlined', ' ' * len(prefix) + '(inlined') - if '??' in addr2line_filtered: - addr2line_filtered = "%s+%s" % (os.path.basename(entry[1]), entry[2]) + raw, frame_id = entry['raw'], entry['frame_id'] + prefix = '#%s: ' % frame_id + if entry.has_key('debug_binary') and entry.has_key('pc_offset'): + # Invoke addr2line on the host-side binary to resolve the symbol. + addr2line_output = subprocess.check_output( + ['addr2line', '-s', '-Cipf', '--exe=' + entry['debug_binary'], + entry['pc_offset']]) + + # addr2line outputs a second line for inlining information, offset + # that to align it properly after the frame index. + addr2line_filtered = addr2line_output.strip().replace( + '(inlined', ' ' * len(prefix) + '(inlined') + + # If symbolization files just output the raw backtrace. + if '??' in addr2line_filtered: + addr2line_filtered = raw + else: + addr2line_filtered = raw + return '%s%s' % (prefix, addr2line_filtered) -def _ParallelSymbolizeBacktrace(backtrace): +def _FindDebugBinary(entry, file_mapping): + """Looks up the binary listed in |entry| in the |file_mapping|, and returns + the corresponding host-side binary's filename, or None.""" + binary = entry['binary'] + if not binary: + return None + + app_prefix = 'app:' + if binary.startswith(app_prefix): + binary = binary[len(app_prefix):] + + # Names in |file_mapping| are all relative to "/system/". + path_prefix = '/system/' + if not binary.startswith(path_prefix): + return None + binary = binary[len(path_prefix):] + + if binary in file_mapping: + return file_mapping[binary] + + # |binary| may be truncated by the crashlogger, so if there is a unique + # match for the truncated name in |file_mapping|, use that instead. + matches = filter(lambda x: x.startswith(binary), file_mapping.keys()) + if len(matches) == 1: + return file_mapping[matches[0]] + + return None + +def _ParallelSymbolizeBacktrace(backtrace, file_mapping): # Disable handling of SIGINT during sub-process creation, to prevent # sub-processes from consuming Ctrl-C signals, rather than the parent # process doing so. @@ -210,6 +272,12 @@ # Restore the signal handler for the parent process. signal.signal(signal.SIGINT, saved_sigint_handler) + # Resolve the |binary| name in each entry to a host-accessible filename. + for entry in backtrace: + debug_binary = _FindDebugBinary(entry, file_mapping) + if debug_binary: + entry['debug_binary'] = debug_binary + symbolized = [] try: result = p.map_async(_SymbolizeEntry, backtrace) @@ -224,7 +292,8 @@ return symbolized -def RunFuchsia(bootfs, exe_name, use_device, dry_run): +def RunFuchsia(bootfs_and_manifest, use_device, dry_run): + bootfs, bootfs_manifest = bootfs_and_manifest kernel_path = os.path.join(SDK_ROOT, 'kernel', 'magenta.bin') if use_device: @@ -269,27 +338,30 @@ return 0 # Set up backtrace-parsing regexps. - prefix = r'^.*> ' - bt_end_re = re.compile(prefix + '(bt)?#(\d+):? end') - bt_with_offset_re = re.compile( - prefix + 'bt#(\d+): pc 0x[0-9a-f]+ sp (0x[0-9a-f]+) ' + - '\((\S+),(0x[0-9a-f]+)\)$') - in_process_re = re.compile(prefix + - '#(\d+) 0x[0-9a-f]+ \S+\+(0x[0-9a-f]+)$') + qemu_prefix = re.compile(r'^.*> ') + backtrace_prefix = re.compile(r'bt#(?P<frame_id>\d+): ') + + # Back-trace line matcher/parser assumes that 'pc' is always present, and + # expects that 'sp' and ('binary','pc_offset') may also be provided. + backtrace_entry = re.compile( + r'pc 0(?:x[0-9a-f]+)? ' + + r'(?:sp 0x[0-9a-f]+ )?' + + r'(?:\((?P<binary>\S+),(?P<pc_offset>0x[0-9a-f]+)\))?$') # We pass a separate stdin stream to qemu. Sharing stdin across processes # leads to flakiness due to the OS prematurely killing the stream and the # Python script panicking and aborting. # The precise root cause is still nebulous, but this fix works. - # See crbug.com/741194 . + # See crbug.com/741194. qemu_popen = subprocess.Popen( qemu_command, stdout=subprocess.PIPE, stdin=open(os.devnull)) - # A buffer of backtrace entries awaiting symbolization, stored as tuples. - # Element #0: backtrace frame number (starting at 0). - # Element #1: path to executable code corresponding to the current frame. - # Element #2: memory offset within the executable. - bt_entries = [] + # A buffer of backtrace entries awaiting symbolization, stored as dicts: + # raw: The original back-trace line that followed the prefix. + # frame_id: backtrace frame number (starting at 0). + # binary: path to executable code corresponding to the current frame. + # pc_offset: memory offset within the executable. + backtrace_entries = [] success = False while True: @@ -299,34 +371,43 @@ if 'SUCCESS: all tests passed.' in line: success = True - # Check for an end-of-backtrace marker. - if bt_end_re.match(line): - if bt_entries: - print '----- start symbolized stack' - for processed in _ParallelSymbolizeBacktrace(bt_entries): + # If the line is not from QEMU then don't try to process it. + matched = qemu_prefix.match(line) + if not matched: + print line + continue + guest_line = line[matched.end():] + + # Look for the back-trace prefix, otherwise just print the line. + matched = backtrace_prefix.match(guest_line) + if not matched: + print line + continue + backtrace_line = guest_line[matched.end():] + + # If this was the end of a back-trace then symbolize and print it. + frame_id = matched.group('frame_id') + if backtrace_line == 'end': + if backtrace_entries: + for processed in _ParallelSymbolizeBacktrace(backtrace_entries, + bootfs_manifest): print processed - print '----- end symbolized stack' - bt_entries = [] + backtrace_entries = [] continue - # Try to parse this as a Fuchsia system backtrace. - m = bt_with_offset_re.match(line) - if m: - bt_entries.append((m.group(1), exe_name, m.group(4))) - continue - - # Try to parse the line as an in-process backtrace entry. - m = in_process_re.match(line) - if m: - bt_entries.append((m.group(1), exe_name, m.group(2))) - continue - - # Some other line, so print it. Back-traces should not be interleaved with - # other output, so while this may re-order lines we see, it should actually - # make things more readable. - print line + # Otherwise, parse the program-counter offset, etc into |backtrace_entries|. + matched = backtrace_entry.match(backtrace_line) + if matched: + # |binary| and |pc_offset| will be None if not present. + backtrace_entries.append( + {'raw': backtrace_line, 'frame_id': frame_id, + 'binary': matched.group('binary'), + 'pc_offset': matched.group('pc_offset')}) + else: + backtrace_entries.append( + {'raw': backtrace_line, 'frame_id': frame_id, + 'binary': None, 'pc_offset': None}) qemu_popen.wait() return 0 if success else 1 -
diff --git a/build/fuchsia/test_runner.py b/build/fuchsia/test_runner.py index 7d0951a8..c883658 100755 --- a/build/fuchsia/test_runner.py +++ b/build/fuchsia/test_runner.py
@@ -170,7 +170,7 @@ if not bootfs: return 2 - return RunFuchsia(bootfs, args.exe_name, args.device, args.dry_run) + return RunFuchsia(bootfs, args.device, args.dry_run) if __name__ == '__main__':
diff --git a/cc/ipc/BUILD.gn b/cc/ipc/BUILD.gn index aba496d..532f12e 100644 --- a/cc/ipc/BUILD.gn +++ b/cc/ipc/BUILD.gn
@@ -50,7 +50,6 @@ "surface_id.mojom", "texture_mailbox.mojom", "texture_mailbox_releaser.mojom", - "transferable_resource.mojom", ] public_deps = [
diff --git a/cc/ipc/cc_serialization_perftest.cc b/cc/ipc/cc_serialization_perftest.cc index 152b699f..12a0acc4 100644 --- a/cc/ipc/cc_serialization_perftest.cc +++ b/cc/ipc/cc_serialization_perftest.cc
@@ -10,7 +10,6 @@ #include "cc/ipc/cc_param_traits.h" #include "cc/ipc/shared_quad_state_struct_traits.h" #include "cc/ipc/surface_id_struct_traits.h" -#include "cc/ipc/transferable_resource_struct_traits.h" #include "cc/output/compositor_frame.h" #include "cc/quads/picture_draw_quad.h" #include "gpu/ipc/common/mailbox_holder_struct_traits.h"
diff --git a/cc/ipc/struct_traits_unittest.cc b/cc/ipc/struct_traits_unittest.cc index b0cf3a00b..8f2517ff 100644 --- a/cc/ipc/struct_traits_unittest.cc +++ b/cc/ipc/struct_traits_unittest.cc
@@ -86,12 +86,6 @@ std::move(callback).Run(t); } - void EchoTransferableResource( - const viz::TransferableResource& t, - EchoTransferableResourceCallback callback) override { - std::move(callback).Run(t); - } - mojo::BindingSet<TraitsTestService> traits_test_bindings_; DISALLOW_COPY_AND_ASSIGN(StructTraitsTest); }; @@ -482,56 +476,4 @@ #endif } -TEST_F(StructTraitsTest, TransferableResource) { - const uint32_t id = 1337; - const viz::ResourceFormat format = viz::ALPHA_8; - const uint32_t filter = 1234; - const gfx::Size size(1234, 5678); - const int8_t mailbox_name[GL_MAILBOX_SIZE_CHROMIUM] = { - 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2}; - const gpu::CommandBufferNamespace command_buffer_namespace = gpu::IN_PROCESS; - const int32_t extra_data_field = 0xbeefbeef; - const gpu::CommandBufferId command_buffer_id( - gpu::CommandBufferId::FromUnsafeValue(0xdeadbeef)); - const uint64_t release_count = 0xdeadbeefdeadL; - const uint32_t texture_target = 1337; - const bool read_lock_fences_enabled = true; - const bool is_software = false; - const uint32_t shared_bitmap_sequence_number = 123456; - const bool is_overlay_candidate = true; - - gpu::MailboxHolder mailbox_holder; - mailbox_holder.mailbox.SetName(mailbox_name); - mailbox_holder.sync_token = - gpu::SyncToken(command_buffer_namespace, extra_data_field, - command_buffer_id, release_count); - mailbox_holder.texture_target = texture_target; - viz::TransferableResource input; - input.id = id; - input.format = format; - input.filter = filter; - input.size = size; - input.mailbox_holder = mailbox_holder; - input.read_lock_fences_enabled = read_lock_fences_enabled; - input.is_software = is_software; - input.shared_bitmap_sequence_number = shared_bitmap_sequence_number; - input.is_overlay_candidate = is_overlay_candidate; - mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); - viz::TransferableResource output; - proxy->EchoTransferableResource(input, &output); - EXPECT_EQ(id, output.id); - EXPECT_EQ(format, output.format); - EXPECT_EQ(filter, output.filter); - EXPECT_EQ(size, output.size); - EXPECT_EQ(mailbox_holder.mailbox, output.mailbox_holder.mailbox); - EXPECT_EQ(mailbox_holder.sync_token, output.mailbox_holder.sync_token); - EXPECT_EQ(mailbox_holder.texture_target, - output.mailbox_holder.texture_target); - EXPECT_EQ(read_lock_fences_enabled, output.read_lock_fences_enabled); - EXPECT_EQ(is_software, output.is_software); - EXPECT_EQ(shared_bitmap_sequence_number, - output.shared_bitmap_sequence_number); - EXPECT_EQ(is_overlay_candidate, output.is_overlay_candidate); -} - } // namespace cc
diff --git a/cc/ipc/traits_test_service.mojom b/cc/ipc/traits_test_service.mojom index b96b54ea..bc4e727 100644 --- a/cc/ipc/traits_test_service.mojom +++ b/cc/ipc/traits_test_service.mojom
@@ -12,7 +12,6 @@ import "cc/ipc/shared_quad_state.mojom"; import "cc/ipc/surface_id.mojom"; import "cc/ipc/texture_mailbox.mojom"; -import "cc/ipc/transferable_resource.mojom"; // All functions on this interface echo their arguments to test StructTraits // serialization and deserialization. @@ -44,8 +43,4 @@ [Sync] EchoTextureMailbox(TextureMailbox t) => (TextureMailbox pass); - - [Sync] - EchoTransferableResource(TransferableResource t) => - (TransferableResource pass); };
diff --git a/cc/ipc/transferable_resource.typemap b/cc/ipc/transferable_resource.typemap deleted file mode 100644 index ab9ccff0..0000000 --- a/cc/ipc/transferable_resource.typemap +++ /dev/null
@@ -1,11 +0,0 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -mojom = "//cc/ipc/transferable_resource.mojom" -public_headers = [ "//components/viz/common/resources/transferable_resource.h" ] -traits_headers = [ "//cc/ipc/transferable_resource_struct_traits.h" ] -sources = [ - "transferable_resource_struct_traits.cc", -] -type_mappings = [ "cc.mojom.TransferableResource=viz::TransferableResource" ]
diff --git a/cc/ipc/typemaps.gni b/cc/ipc/typemaps.gni index 331b748b..ca328cb 100644 --- a/cc/ipc/typemaps.gni +++ b/cc/ipc/typemaps.gni
@@ -13,5 +13,4 @@ "//cc/ipc/shared_quad_state.typemap", "//cc/ipc/surface_id.typemap", "//cc/ipc/texture_mailbox.typemap", - "//cc/ipc/transferable_resource.typemap", ]
diff --git a/chrome/android/java/res/drawable-hdpi/ic_videocam_white_24dp.png b/chrome/android/java/res/drawable-hdpi/ic_videocam_white_24dp.png new file mode 100644 index 0000000..189520f --- /dev/null +++ b/chrome/android/java/res/drawable-hdpi/ic_videocam_white_24dp.png Binary files differ
diff --git a/chrome/android/java/res/drawable-hdpi/ic_videocam_white_36dp.png b/chrome/android/java/res/drawable-hdpi/ic_videocam_white_36dp.png new file mode 100644 index 0000000..5e66856 --- /dev/null +++ b/chrome/android/java/res/drawable-hdpi/ic_videocam_white_36dp.png Binary files differ
diff --git a/chrome/android/java/res/drawable-hdpi/list_item_bottom.9.png b/chrome/android/java/res/drawable-hdpi/list_item_bottom.9.png deleted file mode 100644 index f77d168..0000000 --- a/chrome/android/java/res/drawable-hdpi/list_item_bottom.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-hdpi/list_item_middle.9.png b/chrome/android/java/res/drawable-hdpi/list_item_middle.9.png deleted file mode 100644 index 44204aee..0000000 --- a/chrome/android/java/res/drawable-hdpi/list_item_middle.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-hdpi/list_item_single.9.png b/chrome/android/java/res/drawable-hdpi/list_item_single.9.png deleted file mode 100644 index 73e2249..0000000 --- a/chrome/android/java/res/drawable-hdpi/list_item_single.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-hdpi/list_item_top.9.png b/chrome/android/java/res/drawable-hdpi/list_item_top.9.png deleted file mode 100644 index e873221b9..0000000 --- a/chrome/android/java/res/drawable-hdpi/list_item_top.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-hdpi/permission_camera.png b/chrome/android/java/res/drawable-hdpi/permission_camera.png deleted file mode 100644 index 186a2f3..0000000 --- a/chrome/android/java/res/drawable-hdpi/permission_camera.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/ic_videocam_white_24dp.png b/chrome/android/java/res/drawable-mdpi/ic_videocam_white_24dp.png new file mode 100644 index 0000000..58c175cf --- /dev/null +++ b/chrome/android/java/res/drawable-mdpi/ic_videocam_white_24dp.png Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/ic_videocam_white_36dp.png b/chrome/android/java/res/drawable-mdpi/ic_videocam_white_36dp.png new file mode 100644 index 0000000..189520f --- /dev/null +++ b/chrome/android/java/res/drawable-mdpi/ic_videocam_white_36dp.png Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/list_item_bottom.9.png b/chrome/android/java/res/drawable-mdpi/list_item_bottom.9.png deleted file mode 100644 index 3a5295e..0000000 --- a/chrome/android/java/res/drawable-mdpi/list_item_bottom.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/list_item_middle.9.png b/chrome/android/java/res/drawable-mdpi/list_item_middle.9.png deleted file mode 100644 index 4e07e11..0000000 --- a/chrome/android/java/res/drawable-mdpi/list_item_middle.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/list_item_single.9.png b/chrome/android/java/res/drawable-mdpi/list_item_single.9.png deleted file mode 100644 index 0d365d0..0000000 --- a/chrome/android/java/res/drawable-mdpi/list_item_single.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/list_item_top.9.png b/chrome/android/java/res/drawable-mdpi/list_item_top.9.png deleted file mode 100644 index 672498d..0000000 --- a/chrome/android/java/res/drawable-mdpi/list_item_top.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/permission_camera.png b/chrome/android/java/res/drawable-mdpi/permission_camera.png deleted file mode 100644 index 926d9b25..0000000 --- a/chrome/android/java/res/drawable-mdpi/permission_camera.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/ic_videocam_white_24dp.png b/chrome/android/java/res/drawable-xhdpi/ic_videocam_white_24dp.png new file mode 100644 index 0000000..4a3bf8a --- /dev/null +++ b/chrome/android/java/res/drawable-xhdpi/ic_videocam_white_24dp.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/ic_videocam_white_36dp.png b/chrome/android/java/res/drawable-xhdpi/ic_videocam_white_36dp.png new file mode 100644 index 0000000..4411cb8 --- /dev/null +++ b/chrome/android/java/res/drawable-xhdpi/ic_videocam_white_36dp.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/list_item_bottom.9.png b/chrome/android/java/res/drawable-xhdpi/list_item_bottom.9.png deleted file mode 100644 index ad84d13..0000000 --- a/chrome/android/java/res/drawable-xhdpi/list_item_bottom.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/list_item_middle.9.png b/chrome/android/java/res/drawable-xhdpi/list_item_middle.9.png deleted file mode 100644 index a1344e4..0000000 --- a/chrome/android/java/res/drawable-xhdpi/list_item_middle.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/list_item_single.9.png b/chrome/android/java/res/drawable-xhdpi/list_item_single.9.png deleted file mode 100644 index f3b2271..0000000 --- a/chrome/android/java/res/drawable-xhdpi/list_item_single.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/list_item_top.9.png b/chrome/android/java/res/drawable-xhdpi/list_item_top.9.png deleted file mode 100644 index 99b0a86..0000000 --- a/chrome/android/java/res/drawable-xhdpi/list_item_top.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/permission_camera.png b/chrome/android/java/res/drawable-xhdpi/permission_camera.png deleted file mode 100644 index 242653ac..0000000 --- a/chrome/android/java/res/drawable-xhdpi/permission_camera.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/ic_videocam_white_24dp.png b/chrome/android/java/res/drawable-xxhdpi/ic_videocam_white_24dp.png new file mode 100644 index 0000000..4411cb8 --- /dev/null +++ b/chrome/android/java/res/drawable-xxhdpi/ic_videocam_white_24dp.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/ic_videocam_white_36dp.png b/chrome/android/java/res/drawable-xxhdpi/ic_videocam_white_36dp.png new file mode 100644 index 0000000..1f5189e --- /dev/null +++ b/chrome/android/java/res/drawable-xxhdpi/ic_videocam_white_36dp.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/list_item_bottom.9.png b/chrome/android/java/res/drawable-xxhdpi/list_item_bottom.9.png deleted file mode 100644 index 43ee2677..0000000 --- a/chrome/android/java/res/drawable-xxhdpi/list_item_bottom.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/list_item_middle.9.png b/chrome/android/java/res/drawable-xxhdpi/list_item_middle.9.png deleted file mode 100644 index aa75eda..0000000 --- a/chrome/android/java/res/drawable-xxhdpi/list_item_middle.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/list_item_single.9.png b/chrome/android/java/res/drawable-xxhdpi/list_item_single.9.png deleted file mode 100644 index c422897..0000000 --- a/chrome/android/java/res/drawable-xxhdpi/list_item_single.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/list_item_top.9.png b/chrome/android/java/res/drawable-xxhdpi/list_item_top.9.png deleted file mode 100644 index 5bfc1d5..0000000 --- a/chrome/android/java/res/drawable-xxhdpi/list_item_top.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/permission_camera.png b/chrome/android/java/res/drawable-xxhdpi/permission_camera.png deleted file mode 100644 index 7db1e6a..0000000 --- a/chrome/android/java/res/drawable-xxhdpi/permission_camera.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/ic_videocam_white_24dp.png b/chrome/android/java/res/drawable-xxxhdpi/ic_videocam_white_24dp.png new file mode 100644 index 0000000..7d745ee9 --- /dev/null +++ b/chrome/android/java/res/drawable-xxxhdpi/ic_videocam_white_24dp.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/ic_videocam_white_36dp.png b/chrome/android/java/res/drawable-xxxhdpi/ic_videocam_white_36dp.png new file mode 100644 index 0000000..865671b --- /dev/null +++ b/chrome/android/java/res/drawable-xxxhdpi/ic_videocam_white_36dp.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/list_item_bottom.9.png b/chrome/android/java/res/drawable-xxxhdpi/list_item_bottom.9.png deleted file mode 100644 index d5aafce..0000000 --- a/chrome/android/java/res/drawable-xxxhdpi/list_item_bottom.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/list_item_middle.9.png b/chrome/android/java/res/drawable-xxxhdpi/list_item_middle.9.png deleted file mode 100644 index 02be550..0000000 --- a/chrome/android/java/res/drawable-xxxhdpi/list_item_middle.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/list_item_single.9.png b/chrome/android/java/res/drawable-xxxhdpi/list_item_single.9.png deleted file mode 100644 index 88f61fe..0000000 --- a/chrome/android/java/res/drawable-xxxhdpi/list_item_single.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/list_item_top.9.png b/chrome/android/java/res/drawable-xxxhdpi/list_item_top.9.png deleted file mode 100644 index eafa88ba..0000000 --- a/chrome/android/java/res/drawable-xxxhdpi/list_item_top.9.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/permission_camera.png b/chrome/android/java/res/drawable-xxxhdpi/permission_camera.png deleted file mode 100644 index 06775ac..0000000 --- a/chrome/android/java/res/drawable-xxxhdpi/permission_camera.png +++ /dev/null Binary files differ
diff --git a/chrome/android/java/res/drawable/bookmark_title_bar_shadow.xml b/chrome/android/java/res/drawable/bookmark_title_bar_shadow.xml deleted file mode 100644 index 60d47f5..0000000 --- a/chrome/android/java/res/drawable/bookmark_title_bar_shadow.xml +++ /dev/null
@@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2015 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. --> - -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle" > - - <gradient - android:angle="270" - android:endColor="#00000000" - android:startColor="#30000000" - android:type="linear" /> - -</shape> \ No newline at end of file
diff --git a/chrome/android/java/res/drawable/permission_camera.xml b/chrome/android/java/res/drawable/permission_camera.xml new file mode 100644 index 0000000..b58d6a2a --- /dev/null +++ b/chrome/android/java/res/drawable/permission_camera.xml
@@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2017 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> + +<!-- TODO(huayinz): make infobar_camera like this once it is audited. --> +<bitmap + xmlns:android="http://schemas.android.com/apk/res/android" + android:src="@drawable/ic_videocam_white_24dp" + android:tint="@color/toolbar_light_tint" /> \ No newline at end of file
diff --git a/chrome/android/java/res/layout/bookmark_action_bar.xml b/chrome/android/java/res/layout/bookmark_action_bar.xml index f055547d8..4f04ab0 100644 --- a/chrome/android/java/res/layout/bookmark_action_bar.xml +++ b/chrome/android/java/res/layout/bookmark_action_bar.xml
@@ -7,4 +7,5 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/bookmark_action_bar" android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" /> + android:layout_height="@dimen/toolbar_height_no_shadow" + style="@style/ModernToolbar" />
diff --git a/chrome/android/java/res/layout/bookmark_add_edit_folder_activity.xml b/chrome/android/java/res/layout/bookmark_add_edit_folder_activity.xml index 22f4531f..a9eb5b5e 100644 --- a/chrome/android/java/res/layout/bookmark_add_edit_folder_activity.xml +++ b/chrome/android/java/res/layout/bookmark_add_edit_folder_activity.xml
@@ -3,29 +3,16 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> -<LinearLayout +<merge xmlns:android="http://schemas.android.com/apk/res/android" xmlns:chrome="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:minHeight="@dimen/bookmark_minimum_dialog_size_tablet" - android:orientation="vertical" > - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" /> - - <View - android:layout_width="match_parent" - android:layout_height="4dp" - android:layout_marginBottom="-4dp" - android:background="@drawable/bookmark_title_bar_shadow" /> + android:minHeight="@dimen/bookmark_minimum_dialog_size_tablet" > <ScrollView android:layout_width="match_parent" - android:layout_height="match_parent" > + android:layout_height="match_parent" + android:paddingTop="@dimen/toolbar_height_no_shadow" + android:clipToPadding="false" > <LinearLayout android:layout_width="match_parent" @@ -55,7 +42,7 @@ android:layout_marginTop="24dp" android:text="@string/bookmark_parent_folder" android:textColor="@color/bookmark_detail_section" - android:textSize="14sp" + android:textSize="@dimen/text_size_medium" android:textStyle="bold" /> <TextView @@ -66,8 +53,14 @@ android:layout_marginTop="8dp" android:layout_marginBottom="32dp" android:textColor="@color/dark_mode_tint" - android:textSize="16sp" /> + android:textSize="@dimen/text_size_large" /> </LinearLayout> </ScrollView> -</LinearLayout> + <android.support.v7.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="@dimen/toolbar_height_no_shadow" + style="@style/ModernToolbar" /> + +</merge>
diff --git a/chrome/android/java/res/layout/bookmark_edit.xml b/chrome/android/java/res/layout/bookmark_edit.xml index 6ffccd71..758a645 100644 --- a/chrome/android/java/res/layout/bookmark_edit.xml +++ b/chrome/android/java/res/layout/bookmark_edit.xml
@@ -4,27 +4,14 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:chrome="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" > - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" /> - - <View - android:layout_width="match_parent" - android:layout_height="4dp" - android:layout_marginBottom="-4dp" - android:background="@drawable/bookmark_title_bar_shadow" /> +<merge xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:chrome="http://schemas.android.com/apk/res-auto" > <ScrollView android:layout_width="match_parent" - android:layout_height="match_parent" > + android:layout_height="match_parent" + android:paddingTop="@dimen/toolbar_height_no_shadow" + android:clipToPadding="false" > <LinearLayout android:layout_width="match_parent" @@ -85,4 +72,10 @@ </org.chromium.chrome.browser.widget.FloatLabelLayout> </LinearLayout> </ScrollView> -</LinearLayout> + + <android.support.v7.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="@dimen/toolbar_height_no_shadow" + style="@style/ModernToolbar" /> +</merge>
diff --git a/chrome/android/java/res/layout/bookmark_folder_select_activity.xml b/chrome/android/java/res/layout/bookmark_folder_select_activity.xml index eaa7953..b2edc73c 100644 --- a/chrome/android/java/res/layout/bookmark_folder_select_activity.xml +++ b/chrome/android/java/res/layout/bookmark_folder_select_activity.xml
@@ -3,32 +3,21 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:minHeight="@dimen/bookmark_minimum_dialog_size_tablet" - android:orientation="vertical" > - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" /> - - <View - android:layout_width="match_parent" - android:layout_height="4dp" - android:layout_marginBottom="-4dp" - android:background="@drawable/bookmark_title_bar_shadow" /> +<merge xmlns:android="http://schemas.android.com/apk/res/android" + android:minHeight="@dimen/bookmark_minimum_dialog_size_tablet" > <ListView android:id="@+id/bookmark_folder_list" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingBottom="8dp" - android:paddingTop="8dp" + android:paddingTop="@dimen/bookmark_list_view_padding_top" android:clipToPadding="false" android:divider="@null" android:dividerHeight="0dp" /> -</LinearLayout> + <android.support.v7.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="@dimen/toolbar_height_no_shadow" + style="@style/ModernToolbar" /> +</merge>
diff --git a/chrome/android/java/res/layout/bookmark_main.xml b/chrome/android/java/res/layout/bookmark_main.xml index 5eb4beed..0c98894 100644 --- a/chrome/android/java/res/layout/bookmark_main.xml +++ b/chrome/android/java/res/layout/bookmark_main.xml
@@ -8,4 +8,4 @@ android:id="@+id/selectable_list" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/default_primary_color" /> + android:background="@color/modern_primary_color" />
diff --git a/chrome/android/java/res/layout/bookmark_row_content.xml b/chrome/android/java/res/layout/bookmark_row_content.xml index 30f8c4b..38314f6 100644 --- a/chrome/android/java/res/layout/bookmark_row_content.xml +++ b/chrome/android/java/res/layout/bookmark_row_content.xml
@@ -12,7 +12,9 @@ android:id="@+id/bookmark_row" android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="center_vertical" + android:layout_marginStart="@dimen/list_item_default_margin" + android:paddingTop="16dp" + android:paddingBottom="16dp" android:orientation="horizontal" > <ImageView @@ -22,18 +24,30 @@ android:contentDescription="@null" android:scaleType="center"/> - <TextView - android:id="@+id/title" + <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:minHeight="48dp" - android:singleLine="true" - android:gravity="center_vertical" - android:textAlignment="viewStart" - android:textColor="@color/default_text_color" - android:textSize="16sp" - android:paddingStart="16dp" /> + android:orientation="vertical" + android:paddingStart="20dp" > + + <TextView + android:id="@+id/title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="end" + android:textAppearance="@style/BlackTitle1" /> + + <TextView + android:id="@+id/description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="end" + android:textAppearance="@style/BlackBody" /> + + </LinearLayout> <org.chromium.chrome.browser.widget.TintedImageButton android:id="@+id/more"
diff --git a/chrome/android/java/res/layout/bottom_sheet_bottom_nav.xml b/chrome/android/java/res/layout/bottom_sheet_bottom_nav.xml index ee27426..6130b67 100644 --- a/chrome/android/java/res/layout/bottom_sheet_bottom_nav.xml +++ b/chrome/android/java/res/layout/bottom_sheet_bottom_nav.xml
@@ -2,7 +2,7 @@ <!-- Copyright 2016 The Chromium Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> - + <org.chromium.chrome.browser.widget.bottomsheet.BottomSheetContentController xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" @@ -10,7 +10,7 @@ android:layout_width="match_parent" android:layout_height="@dimen/bottom_nav_height" android:layout_gravity="start|bottom" - android:background="@color/default_primary_color" + android:background="@color/modern_primary_color" app:menu="@menu/bottom_sheet_nav_menu" app:itemIconTint="@color/bottom_nav_tint" app:itemTextColor="@color/bottom_nav_tint"
diff --git a/chrome/android/java/res/layout/download_item_view.xml b/chrome/android/java/res/layout/download_item_view.xml index abb421ce..e4713eb 100644 --- a/chrome/android/java/res/layout/download_item_view.xml +++ b/chrome/android/java/res/layout/download_item_view.xml
@@ -30,17 +30,11 @@ android:id="@+id/filename_completed_view" style="@style/DownloadTitleStyle" android:layout_alignParentEnd="true" /> - + <TextView - android:id="@+id/hostname_view" + android:id="@+id/description_view" style="@style/DownloadDescriptionStyle" - android:layout_toStartOf="@+id/filesize_view" android:layout_below="@+id/filename_completed_view" /> - - <TextView - android:id="@+id/filesize_view" - style="@style/DownloadFileSizeStyle" - android:layout_below="@+id/filename_completed_view"/> </RelativeLayout> <!-- Shown for downloads that haven't been completed. --> @@ -60,8 +54,7 @@ android:layout_toStartOf="@+id/pause_button" android:minHeight="18dp" android:singleLine="true" - android:textColor="@color/default_text_color" - android:textSize="14sp" /> + android:textAppearance="@style/BlackBodyDefault" /> <org.chromium.chrome.browser.widget.MaterialProgressBar android:id="@+id/download_progress_view"
diff --git a/chrome/android/java/res/layout/download_main.xml b/chrome/android/java/res/layout/download_main.xml index 79fd352..15dc1e2 100644 --- a/chrome/android/java/res/layout/download_main.xml +++ b/chrome/android/java/res/layout/download_main.xml
@@ -8,4 +8,4 @@ android:id="@+id/selectable_list" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/default_primary_color"/> + android:background="@color/modern_primary_color"/>
diff --git a/chrome/android/java/res/layout/download_manager_spinner.xml b/chrome/android/java/res/layout/download_manager_spinner.xml index 4c5d5dd..4d57deb 100644 --- a/chrome/android/java/res/layout/download_manager_spinner.xml +++ b/chrome/android/java/res/layout/download_manager_spinner.xml
@@ -6,6 +6,4 @@ <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textAppearance="@style/RobotoMediumStyle" - android:textColor="@color/black_alpha_87" - android:textSize="20sp" /> \ No newline at end of file + android:textAppearance="@style/BlackHeadline1" /> \ No newline at end of file
diff --git a/chrome/android/java/res/layout/download_manager_ui_space_widget.xml b/chrome/android/java/res/layout/download_manager_ui_space_widget.xml index b733862..22a11a3 100644 --- a/chrome/android/java/res/layout/download_manager_ui_space_widget.xml +++ b/chrome/android/java/res/layout/download_manager_ui_space_widget.xml
@@ -4,15 +4,23 @@ found in the LICENSE file. --> <LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:chrome="http://schemas.android.com/apk/res-auto" + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:chrome="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="11dp" + android:paddingBottom="6dp" + android:orientation="vertical" > + + <LinearLayout + android:id="@+id/space_widget_content" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="11dp" - android:paddingBottom="6dp" - android:orientation="vertical" > + android:orientation="vertical" + android:layout_marginStart="@dimen/list_item_default_margin" + android:layout_marginEnd="@dimen/list_item_default_margin" > - <TextView + <TextView android:id="@+id/size_downloaded" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -21,8 +29,8 @@ android:textColor="@color/google_blue_500" android:textSize="16sp" /> - <!-- The progress bar uses 20dp of space, vertically, including spacing. --> - <org.chromium.chrome.browser.widget.MaterialProgressBar + <!-- The progress bar uses 20dp of space, vertically, including spacing. --> + <org.chromium.chrome.browser.widget.MaterialProgressBar android:id="@+id/space_bar" android:layout_width="match_parent" android:layout_height="4dp" @@ -32,7 +40,7 @@ chrome:colorProgress="@color/google_blue_500" chrome:colorSecondaryProgress="@color/black_alpha_87" /> - <TextView + <TextView android:id="@+id/size_other_apps" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -40,7 +48,7 @@ android:textColor="@color/black_alpha_87" android:textSize="14sp" /> - <TextView + <TextView android:id="@+id/size_free" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -48,4 +56,10 @@ android:textColor="@color/black_alpha_54" android:textSize="14sp" /> + </LinearLayout> + + <View + style="@style/Divider" + android:layout_marginTop="@dimen/list_item_default_margin" /> + </LinearLayout> \ No newline at end of file
diff --git a/chrome/android/java/res/layout/history_clear_browsing_data_header.xml b/chrome/android/java/res/layout/history_clear_browsing_data_header.xml index 207c6ce..8057f65 100644 --- a/chrome/android/java/res/layout/history_clear_browsing_data_header.xml +++ b/chrome/android/java/res/layout/history_clear_browsing_data_header.xml
@@ -3,18 +3,12 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingBottom="8dp" - android:background="@null" > + android:orientation="vertical" + android:paddingBottom="8dp" > - <FrameLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@drawable/list_item_single" > - <!-- TODO(twellington): change start/end padding back to 16dp and remove duplicate - FrameLayout when list item background is removed. --> <Button android:id="@+id/clear_browsing_data_button" android:layout_width="match_parent" @@ -23,12 +17,14 @@ style="@style/ButtonCompatBorderless" android:paddingTop="16dp" android:paddingBottom="16dp" - android:paddingStart="17dp" - android:paddingEnd="17dp" + android:paddingStart="@dimen/list_item_default_margin" + android:paddingEnd="@dimen/list_item_default_margin" android:gravity="center_vertical|start" android:text="@string/open_clear_browsing_data_dialog_button" android:textAllCaps="true" android:textColor="@color/blue_when_enabled" - android:textSize="14sp" /> - </FrameLayout> -</FrameLayout> \ No newline at end of file + android:textSize="@dimen/text_size_medium" /> + + <View style="@style/Divider" /> + +</LinearLayout> \ No newline at end of file
diff --git a/chrome/android/java/res/layout/history_item_view.xml b/chrome/android/java/res/layout/history_item_view.xml index 1cda7a8..36cfba5 100644 --- a/chrome/android/java/res/layout/history_item_view.xml +++ b/chrome/android/java/res/layout/history_item_view.xml
@@ -18,10 +18,9 @@ android:id="@+id/content" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginStart="@dimen/list_item_default_margin" android:paddingTop="16dp" android:paddingBottom="16dp" - android:layout_marginStart="@dimen/list_item_lateral_padding" - android:layout_marginEnd="@dimen/list_item_lateral_padding" android:orientation="horizontal" > <ImageView @@ -31,11 +30,11 @@ android:src="@drawable/default_favicon" /> <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="vertical" - android:paddingStart="16dp" > + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical" + android:paddingStart="20dp" > <TextView android:id="@+id/title" @@ -43,8 +42,7 @@ android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="end" - android:textColor="@color/default_text_color" - android:textSize="16sp" /> + android:textAppearance="@style/BlackTitle1" /> <TextView android:id="@+id/domain" @@ -52,8 +50,7 @@ android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="end" - android:textColor="@color/black_alpha_54" - android:textSize="14sp" /> + android:textAppearance="@style/BlackBody" /> </LinearLayout> <org.chromium.chrome.browser.widget.TintedImageButton
diff --git a/chrome/android/java/res/layout/history_main.xml b/chrome/android/java/res/layout/history_main.xml index 173e178..f72a485 100644 --- a/chrome/android/java/res/layout/history_main.xml +++ b/chrome/android/java/res/layout/history_main.xml
@@ -7,4 +7,4 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/default_primary_color" /> \ No newline at end of file + android:background="@color/modern_primary_color" /> \ No newline at end of file
diff --git a/chrome/android/java/res/layout/history_privacy_disclaimer_header.xml b/chrome/android/java/res/layout/history_privacy_disclaimer_header.xml index cad7fbd..f19f8d1 100644 --- a/chrome/android/java/res/layout/history_privacy_disclaimer_header.xml +++ b/chrome/android/java/res/layout/history_privacy_disclaimer_header.xml
@@ -21,8 +21,17 @@ android:id="@+id/other_forms_of_browsing_history" style="@style/PrivacyDisclaimerText" /> - <Space + <LinearLayout android:id="@+id/privacy_disclaimer_bottom_space" android:layout_width="match_parent" - android:layout_height="8dp" /> + android:layout_height="wrap_content" + android:orientation="vertical" > + + <Space + android:layout_width="match_parent" + android:layout_height="8dp" /> + + <View style="@style/Divider" /> + + </LinearLayout> </LinearLayout> \ No newline at end of file
diff --git a/chrome/android/java/res/layout/history_toolbar.xml b/chrome/android/java/res/layout/history_toolbar.xml index ef348e0..a42ce27d 100644 --- a/chrome/android/java/res/layout/history_toolbar.xml +++ b/chrome/android/java/res/layout/history_toolbar.xml
@@ -9,4 +9,5 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:paddingStart="0dp" - android:paddingEnd="0dp" /> \ No newline at end of file + android:paddingEnd="0dp" + style="@style/ModernToolbar" /> \ No newline at end of file
diff --git a/chrome/android/java/res/layout/new_tab_page_layout.xml b/chrome/android/java/res/layout/new_tab_page_layout.xml index 84fab1f3..41c8927 100644 --- a/chrome/android/java/res/layout/new_tab_page_layout.xml +++ b/chrome/android/java/res/layout/new_tab_page_layout.xml
@@ -104,17 +104,7 @@ android:layout_weight="0" android:visibility="invisible" /> - <!-- Site suggestion tile grid --> - <org.chromium.chrome.browser.suggestions.TileGridLayout - android:id="@+id/tile_grid_layout" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="16dp" - android:layout_marginStart="12dp" - android:layout_marginEnd="12dp" - android:layout_gravity="center_horizontal" - android:paddingTop="@dimen/tile_grid_layout_padding_top" - android:paddingBottom="4dp" /> + <!-- Insertion point of the SiteSectionView, see NewTabPageLayout#insertSiteSection() --> <!-- Site suggestion tile grid placeholder --> <ViewStub
diff --git a/chrome/android/java/res/layout/selectable_list_layout.xml b/chrome/android/java/res/layout/selectable_list_layout.xml index 95f3b91d..65f9b17 100644 --- a/chrome/android/java/res/layout/selectable_list_layout.xml +++ b/chrome/android/java/res/layout/selectable_list_layout.xml
@@ -4,48 +4,42 @@ found in the LICENSE file. --> <merge xmlns:android="http://schemas.android.com/apk/res/android"> + + <android.support.v7.widget.RecyclerView + android:id="@+id/recycler_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingTop="@dimen/toolbar_height_no_shadow" + android:clipToPadding="false" + android:visibility="gone" /> + + <TextView + android:id="@+id/empty_view" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:drawablePadding="3dp" + android:textColor="@color/google_grey_500" + android:textSize="16sp" + android:visibility="gone" /> + + <org.chromium.chrome.browser.widget.LoadingView + android:id="@+id/loading_view" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" /> + <ViewStub android:id="@+id/action_bar_stub" android:inflatedId="@+id/action_bar" android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" + android:layout_height="@dimen/toolbar_height_no_shadow" android:background="@color/default_primary_color" /> - <FrameLayout - android:id="@+id/list_content" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_marginTop="?attr/actionBarSize" > - - <android.support.v7.widget.RecyclerView - android:id="@+id/recycler_view" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:paddingTop="8dp" - android:clipToPadding="false" - android:visibility="gone" /> - - <TextView - android:id="@+id/empty_view" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:drawablePadding="3dp" - android:textColor="@color/google_grey_500" - android:textSize="16sp" - android:visibility="gone" /> - - <org.chromium.chrome.browser.widget.LoadingView - android:id="@+id/loading_view" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" /> - </FrameLayout> - <org.chromium.chrome.browser.widget.FadingShadowView android:id="@+id/shadow" android:layout_width="match_parent" android:layout_height="@dimen/action_bar_shadow_height" - android:layout_marginTop="?attr/actionBarSize" /> + android:layout_marginTop="@dimen/toolbar_height_no_shadow" /> </merge>
diff --git a/chrome/android/java/res/values-v17/styles.xml b/chrome/android/java/res/values-v17/styles.xml index 531528ca..db50ed7d 100644 --- a/chrome/android/java/res/values-v17/styles.xml +++ b/chrome/android/java/res/values-v17/styles.xml
@@ -181,6 +181,7 @@ <item name="android:layout_width">match_parent</item> <item name="android:layout_height">@dimen/divider_height</item> <item name="android:background">@color/google_grey_300</item> + <item name="android:importantForAccessibility">no</item> </style> <style name="ThemeWithActionBar" parent="Theme.AppCompat.Light.DarkActionBar"> @@ -544,6 +545,11 @@ <item name="android:layout_height">match_parent</item> <item name="android:layout_width">match_parent</item> </style> + <style name="ModernToolbar" parent="Widget.AppCompat.Toolbar"> + <item name="android:background">@color/modern_toolbar_bg</item> + <item name="titleTextAppearance">@style/BlackHeadline1</item> + <item name="windowActionBarOverlay">true</item> + </style> <style name="ToolbarButton"> <item name="android:background">?attr/selectableItemBackground</item> <item name="android:layout_width">@dimen/toolbar_button_width</item> @@ -565,9 +571,6 @@ <item name="android:paddingEnd">16dp</item> <item name="android:background">?attr/listChoiceBackgroundIndicator</item> </style> - <style name="BottomSheetContentTitle" parent="TextAppearance.Widget.AppCompat.Toolbar.Title"> - <item name="android:textSize">20sp</item> - </style> <style name="SadTabBodyText"> <item name="android:textColor">@color/sad_tab_body_text_color</item> <item name="android:textSize">14sp</item> @@ -599,17 +602,17 @@ <item name="android:scaleType">center</item> </style> <style name="HistoryEndIcon"> - <item name="android:layout_width">wrap_content</item> + <item name="android:layout_width">@dimen/selectable_list_layout_end_icon_width</item> <item name="android:layout_height">match_parent</item> - <item name="android:paddingStart">16dp</item> <item name="android:background">@null</item> <item name="android:scaleType">center</item> - <item name="android:paddingEnd">@dimen/selectable_list_layout_row_end_padding</item> </style> <style name="PrivacyDisclaimerText"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:layout_marginTop">6dp</item> + <item name="android:layout_marginStart">@dimen/list_item_default_margin</item> + <item name="android:layout_marginEnd">@dimen/list_item_default_margin</item> <item name="android:lineSpacingExtra">6sp</item> <item name="android:textSize">14sp</item> <item name="android:visibility">gone</item> @@ -626,13 +629,14 @@ <item name="android:ellipsize">start</item> <item name="android:singleLine">true</item> </style> - <style name="DateView" parent="RobotoMediumStyle"> + <style name="DateView"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:layout_marginTop">12dp</item> <item name="android:layout_marginBottom">10dp</item> - <item name="android:textSize">14sp</item> - <item name="android:textColor">@color/black_alpha_54</item> + <item name="android:layout_marginStart">@dimen/list_item_default_margin</item> + <item name="android:layout_marginEnd">@dimen/list_item_default_margin</item> + <item name="android:textAppearance">@style/BlackDenseListText2</item> </style> <style name="DownloadRowContainer"> <item name="android:layout_width">match_parent</item> @@ -654,7 +658,7 @@ <item name="android:textSize">16sp</item> </style> <style name="DownloadDescriptionStyle"> - <item name="android:layout_width">0dp</item> + <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:layout_alignParentBottom">true</item> <item name="android:layout_alignParentStart">true</item>
diff --git a/chrome/android/java/res/values/colors.xml b/chrome/android/java/res/values/colors.xml index 86e8292..593f40e 100644 --- a/chrome/android/java/res/values/colors.xml +++ b/chrome/android/java/res/values/colors.xml
@@ -212,5 +212,6 @@ <color name="selectable_list_item_highlight_color">#804281f4</color> <color name="media_viewer_bg">#000000</color> <color name="image_viewer_bg">#0e0e0e</color> + <color name="modern_toolbar_bg">#E6FFFFFF</color> </resources>
diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml index 73ff066..4e6d44a6 100644 --- a/chrome/android/java/res/values/dimens.xml +++ b/chrome/android/java/res/values/dimens.xml
@@ -362,6 +362,7 @@ <dimen name="bookmark_item_popup_width">140dp</dimen> <dimen name="bookmark_folder_item_left">16dp</dimen> <dimen name="bookmark_minimum_dialog_size_tablet">500dp</dimen> + <dimen name="bookmark_list_view_padding_top">64dp</dimen> <!-- Bookmark widget dimensions --> <dimen name="bookmark_widget_min_width">64dp</dimen> @@ -451,10 +452,10 @@ <dimen name="downloads_item_icon_size">48dp</dimen> <!-- SelectableListLayout dimensions --> - <dimen name="selectable_list_layout_row_end_padding">16dp</dimen> - <dimen name="selectable_list_layout_start_icon_width">56dp</dimen> - <dimen name="toolbar_wide_display_nav_icon_offset">-18dp</dimen> - <dimen name="toolbar_wide_display_end_offset">-14dp</dimen> + <dimen name="selectable_list_layout_row_padding">16dp</dimen> + <dimen name="selectable_list_layout_start_icon_width">36dp</dimen> + <dimen name="selectable_list_layout_end_icon_width">56dp</dimen> + <dimen name="toolbar_wide_display_start_offset">13dp</dimen> <!-- Bottom sheet dimensions --> <dimen name="bottom_sheet_help_bubble_inset">10dp</dimen> @@ -465,7 +466,7 @@ <dimen name="design_bottom_navigation_active_text_size">14sp</dimen> <!-- Chrome Home dimensions --> - <dimen name="chrome_home_empty_view_top_padding">16dp</dimen> + <dimen name="chrome_home_empty_view_top_padding">72dp</dimen> <dimen name="chrome_home_min_full_half_distance">160dp</dimen> <dimen name="chrome_home_progress_bar_height">4dp</dimen> @@ -479,8 +480,6 @@ <!-- Miscellaneous dimensions --> <dimen name="action_bar_shadow_height">10dp</dimen> <dimen name="card_corner_radius">2dp</dimen> - <dimen name="list_item_corner_radius">3dp</dimen> - <dimen name="list_item_lateral_padding">1dp</dimen> <dimen name="list_item_default_margin">16dp</dimen> <dimen name="signin_and_sync_view_padding">16dp</dimen> <dimen name="sad_tab_bullet_gap">12dp</dimen>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java index 28a7421..db39c9d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
@@ -13,6 +13,7 @@ import org.chromium.chrome.browser.profiles.Profile; import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.bookmarks.BookmarkType; +import org.chromium.components.url_formatter.UrlFormatter; import java.util.ArrayList; import java.util.List; @@ -192,6 +193,11 @@ return mUrl; } + /** @return The string to display for the item's url. */ + public String getUrlForDisplay() { + return UrlFormatter.formatUrlForSecurityDisplay(getUrl(), false); + } + /** @return Id of the bookmark item. */ public BookmarkId getId() { return mId;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFolderRow.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFolderRow.java index 65d51eb..c94d4d8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFolderRow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFolderRow.java
@@ -42,6 +42,11 @@ BookmarkItem setBookmarkId(BookmarkId bookmarkId) { BookmarkItem item = super.setBookmarkId(bookmarkId); mTitleView.setText(item.getTitle()); + int childCount = mDelegate.getModel().getChildCount(bookmarkId); + mDescriptionView.setText((childCount > 0) + ? getResources().getQuantityString( + R.plurals.bookmarks_count, childCount, childCount) + : getResources().getString(R.string.no_bookmarks)); return item; } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java index 1910fa5..61adf4e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java
@@ -73,6 +73,7 @@ mUrl = item.getUrl(); mIconImageView.setImageDrawable(null); mTitleView.setText(item.getTitle()); + mDescriptionView.setText(item.getUrlForDisplay()); mDelegate.getLargeIconBridge().getLargeIconForUrl(mUrl, mMinIconSize, this); return item; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java index a74a004..8b180731 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
@@ -19,7 +19,6 @@ import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkModelObserver; import org.chromium.chrome.browser.bookmarks.BookmarkPromoHeader.PromoHeaderShowingChangeListener; import org.chromium.chrome.browser.widget.displaystyle.MarginResizer; -import org.chromium.chrome.browser.widget.selection.SelectableListLayout; import org.chromium.components.bookmarks.BookmarkId; import java.util.ArrayList; @@ -154,18 +153,6 @@ assert section == mFolderSection || section == mBookmarkSection; section.remove(toSectionPosition(position)); notifyItemRemoved(position); - - if (section == mBookmarkSection && !mBookmarkSection.isEmpty()) { - for (BookmarkRow row : mBookmarkRows) { - BookmarkId id = row.getItem(); - setBackgroundResourceForBookmarkRow(row, id); - } - } else if (!mFolderSection.isEmpty()) { - for (BookmarkRow row : mFolderRows) { - BookmarkId id = row.getItem(); - setBackgroundResourceForFolderRow(row, id); - } - } } // RecyclerView.Adapter implementation. @@ -206,21 +193,18 @@ mDelegate.getSelectableListLayout().getUiConfig(), parent.getResources().getDimensionPixelSize( R.dimen.signin_and_sync_view_padding), - SelectableListLayout.getDefaultListItemLateralShadowSizePx( - parent.getResources())); + 0); return promoView; case FOLDER_VIEW: BookmarkFolderRow folder = (BookmarkFolderRow) LayoutInflater.from( parent.getContext()).inflate(R.layout.bookmark_folder_row, parent, false); folder.onBookmarkDelegateInitialized(mDelegate); - folder.configureWideDisplayStyle(mDelegate.getSelectableListLayout().getUiConfig()); mFolderRows.add(folder); return new ItemViewHolder(folder); case BOOKMARK_VIEW: BookmarkItemRow item = (BookmarkItemRow) LayoutInflater.from( parent.getContext()).inflate(R.layout.bookmark_item_row, parent, false); item.onBookmarkDelegateInitialized(mDelegate); - item.configureWideDisplayStyle(mDelegate.getSelectableListLayout().getUiConfig()); mBookmarkRows.add(item); return new ItemViewHolder(item); default: @@ -239,11 +223,9 @@ break; case FOLDER_VIEW: ((BookmarkRow) holder.itemView).setBookmarkId(id); - setBackgroundResourceForFolderRow(((BookmarkRow) holder.itemView), id); break; case BOOKMARK_VIEW: ((BookmarkRow) holder.itemView).setBookmarkId(id); - setBackgroundResourceForBookmarkRow((BookmarkRow) holder.itemView, id); break; default: assert false : "View type not supported!"; @@ -372,14 +354,4 @@ public BookmarkDelegate getDelegateForTesting() { return mDelegate; } - - private void setBackgroundResourceForBookmarkRow(BookmarkRow row, BookmarkId id) { - row.setBackgroundResourceForGroupPosition(id.equals(mBookmarkSection.get(0)), - id.equals(mBookmarkSection.get(mBookmarkSection.size() - 1))); - } - - private void setBackgroundResourceForFolderRow(BookmarkRow row, BookmarkId id) { - row.setBackgroundResourceForGroupPosition(id.equals(mFolderSection.get(0)), - id.equals(mFolderSection.get(mFolderSection.size() - 1))); - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java index ddbbd70c6..7c980c4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
@@ -149,7 +149,7 @@ mToolbar = (BookmarkActionBar) mSelectableListLayout.initializeToolbar( R.layout.bookmark_action_bar, mSelectionDelegate, 0, null, R.id.normal_menu_group, - R.id.selection_mode_menu_group, R.color.default_primary_color, null, true); + R.id.selection_mode_menu_group, R.color.modern_toolbar_bg, null, true); mToolbar.initializeSearchView( this, R.string.bookmark_action_bar_search, R.id.search_menu_id);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java index dc31dc96..be4d308 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java
@@ -30,6 +30,7 @@ protected ImageView mIconImageView; protected TextView mTitleView; + protected TextView mDescriptionView; protected TintedImageButton mMoreIcon; protected BookmarkDelegate mDelegate; @@ -166,6 +167,7 @@ mIconImageView = (ImageView) findViewById(R.id.bookmark_image); mTitleView = (TextView) findViewById(R.id.title); + mDescriptionView = (TextView) findViewById(R.id.description); mMoreIcon = (TintedImageButton) findViewById(R.id.more); mMoreIcon.setVisibility(VISIBLE);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSheetContent.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSheetContent.java index 2b0985a..b4c2215 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSheetContent.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSheetContent.java
@@ -87,6 +87,6 @@ @Override public boolean applyDefaultTopPadding() { - return true; + return false; } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadSheetContent.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadSheetContent.java index c0e6523..964bdc2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadSheetContent.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadSheetContent.java
@@ -111,6 +111,6 @@ @Override public boolean applyDefaultTopPadding() { - return true; + return false; } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java index d964c17..a3da632a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java
@@ -842,8 +842,8 @@ return iconSize == ICON_SIZE_24_DP ? R.drawable.ic_drive_site_white_24dp : R.drawable.ic_drive_site_white_36dp; case DownloadFilter.FILTER_VIDEO: - return iconSize == ICON_SIZE_24_DP ? R.drawable.ic_play_arrow_white_24dp - : R.drawable.ic_play_arrow_white_36dp; + return iconSize == ICON_SIZE_24_DP ? R.drawable.ic_videocam_white_24dp + : R.drawable.ic_videocam_white_36dp; case DownloadFilter.FILTER_AUDIO: return iconSize == ICON_SIZE_24_DP ? R.drawable.ic_music_note_white_24dp : R.drawable.ic_music_note_white_36dp;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadFilter.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadFilter.java index 38857a1..8994eab 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadFilter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadFilter.java
@@ -42,7 +42,7 @@ static final int[][] FILTER_LIST = new int[][] { {R.drawable.ic_file_download_white_24dp, R.string.download_manager_ui_all_downloads}, {R.drawable.ic_drive_site_white_24dp, R.string.download_manager_ui_pages}, - {R.drawable.ic_play_arrow_white_24dp, R.string.download_manager_ui_video}, + {R.drawable.ic_videocam_white_24dp, R.string.download_manager_ui_video}, {R.drawable.ic_music_note_white_24dp, R.string.download_manager_ui_audio}, {R.drawable.ic_image_white_24dp, R.string.download_manager_ui_images}, {R.drawable.ic_drive_text_white_24dp, R.string.download_manager_ui_documents},
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java index d4bdf5f7..3e98b21 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java
@@ -30,9 +30,7 @@ import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadBridge; import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; import org.chromium.chrome.browser.widget.DateDividedAdapter; -import org.chromium.chrome.browser.widget.displaystyle.MarginResizer; import org.chromium.chrome.browser.widget.displaystyle.UiConfig; -import org.chromium.chrome.browser.widget.selection.SelectableListLayout; import org.chromium.chrome.browser.widget.selection.SelectionDelegate; import org.chromium.components.offline_items_collection.ContentId; import org.chromium.content_public.browser.DownloadState; @@ -325,7 +323,6 @@ .inflate(R.layout.offline_download_header, parent, false); offlineHeader.setAdapter(this); offlineHeader.setSelectionDelegate((DownloadItemSelectionDelegate) getSelectionDelegate()); - if (mUiConfig != null) offlineHeader.configureWideDisplayStyle(mUiConfig); return new SubsectionHeaderViewHolder(offlineHeader); } @@ -338,23 +335,10 @@ } @Override - protected DateViewHolder createDateViewHolder(ViewGroup parent) { - DateViewHolder viewHolder = super.createDateViewHolder(parent); - if (mUiConfig != null) { - MarginResizer.createAndAttach(viewHolder.itemView, mUiConfig, - parent.getResources().getDimensionPixelSize(R.dimen.list_item_default_margin), - SelectableListLayout.getDefaultListItemLateralShadowSizePx( - parent.getResources())); - } - return viewHolder; - } - - @Override public ViewHolder createViewHolder(ViewGroup parent) { DownloadItemView v = (DownloadItemView) LayoutInflater.from(parent.getContext()).inflate( R.layout.download_item_view, parent, false); v.setSelectionDelegate(getSelectionDelegate()); - if (mUiConfig != null) v.configureWideDisplayStyle(mUiConfig); mViews.add(v); return new DownloadHistoryItemViewHolder(v); } @@ -383,14 +367,8 @@ */ void generateHeaderItems() { mSpaceDisplay = new SpaceDisplay(null, this); - View view = mSpaceDisplay.getView(); + View view = mSpaceDisplay.getViewContainer(); registerAdapterDataObserver(mSpaceDisplay); - if (mUiConfig != null) { - MarginResizer.createAndAttach(view, mUiConfig, - view.getResources().getDimensionPixelSize(R.dimen.list_item_default_margin), - SelectableListLayout.getDefaultListItemLateralShadowSizePx( - view.getResources())); - } mSpaceDisplayHeaderItem = new HeaderItem(0, view); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java index 0d668f8..ca642f2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java
@@ -24,6 +24,8 @@ import org.chromium.components.offline_items_collection.OfflineItem.Progress; import org.chromium.ui.UiUtils; +import java.util.Locale; + /** * The view for a downloaded item displayed in the Downloads list. */ @@ -46,8 +48,7 @@ // Controls for completed downloads. private View mLayoutCompleted; private TextView mFilenameCompletedView; - private TextView mHostnameView; - private TextView mFilesizeView; + private TextView mDescriptionView; // Controls for in-progress downloads. private View mLayoutInProgress; @@ -82,8 +83,7 @@ mLayoutInProgress = findViewById(R.id.progress_layout); mFilenameCompletedView = (TextView) findViewById(R.id.filename_completed_view); - mHostnameView = (TextView) findViewById(R.id.hostname_view); - mFilesizeView = (TextView) findViewById(R.id.filesize_view); + mDescriptionView = (TextView) findViewById(R.id.description_view); mFilenameInProgressView = (TextView) findViewById(R.id.filename_progress_view); mDownloadStatusView = (TextView) findViewById(R.id.status_view); @@ -160,12 +160,13 @@ if (mThumbnailBitmap == null) updateIconView(); - Context context = mFilesizeView.getContext(); + Context context = mDescriptionView.getContext(); mFilenameCompletedView.setText(item.getDisplayFileName()); mFilenameInProgressView.setText(item.getDisplayFileName()); - mHostnameView.setText(item.getDisplayHostname()); - mFilesizeView.setText( - Formatter.formatFileSize(context, item.getFileSize())); + + String description = String.format(Locale.getDefault(), "%s - %s", + Formatter.formatFileSize(context, item.getFileSize()), item.getDisplayHostname()); + mDescriptionView.setText(description); if (item.isComplete()) { showLayout(mLayoutCompleted); @@ -207,8 +208,6 @@ } } - setBackgroundResourceForGroupPosition( - getItem().isFirstInGroup(), getItem().isLastInGroup()); setLongClickable(item.isComplete()); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerUi.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerUi.java index dc7125a..8d1c2f31 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerUi.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerUi.java
@@ -214,7 +214,8 @@ mToolbar = (DownloadManagerToolbar) mSelectableListLayout.initializeToolbar( R.layout.download_manager_toolbar, mBackendProvider.getSelectionDelegate(), 0, null, - R.id.normal_menu_group, R.id.selection_mode_menu_group, null, this, true); + R.id.normal_menu_group, R.id.selection_mode_menu_group, R.color.modern_toolbar_bg, + this, true); mToolbar.setManager(this); mToolbar.initializeFilterSpinner(mFilterAdapter); mToolbar.initializeSearchView(this, R.string.download_manager_search, R.id.search_menu_id);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/FilterAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/FilterAdapter.java index 7b8cf0c..cc5b1ac 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/FilterAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/FilterAdapter.java
@@ -44,7 +44,7 @@ labelView.setText(DownloadFilter.getStringIdForFilter(position)); int iconId = DownloadFilter.getDrawableForFilter(position); Drawable iconDrawable = TintedDrawable.constructTintedDrawable( - mManagerUi.getActivity().getResources(), iconId, R.color.descriptive_text_color); + mManagerUi.getActivity().getResources(), iconId, R.color.toolbar_light_tint); labelView.setCompoundDrawablesWithIntrinsicBounds(iconDrawable, null, null, null); return labelView;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/OfflineGroupHeaderView.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/OfflineGroupHeaderView.java index be97920c..8526aa1f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/OfflineGroupHeaderView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/OfflineGroupHeaderView.java
@@ -92,7 +92,6 @@ mFileSizeView.setText(Formatter.formatFileSize(getContext(), header.getTotalFileSize())); updateExpandIcon(header.isExpanded()); setChecked(mSelectionDelegate.isHeaderSelected(header)); - setBackgroundResourceForGroupPosition(mHeader.isFirstInGroup(), mHeader.isLastInGroup()); } private void updateExpandIcon(boolean expanded) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/SpaceDisplay.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/SpaceDisplay.java index 1e599c1..92557ca 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/SpaceDisplay.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/SpaceDisplay.java
@@ -107,6 +107,7 @@ private DownloadHistoryAdapter mHistoryAdapter; private View mView; + private View mViewContainer; private TextView mSpaceUsedByDownloadsTextView; private TextView mSpaceUsedByOtherAppsTextView; private TextView mSpaceFreeTextView; @@ -115,8 +116,9 @@ SpaceDisplay(final ViewGroup parent, DownloadHistoryAdapter historyAdapter) { mHistoryAdapter = historyAdapter; - mView = LayoutInflater.from(ContextUtils.getApplicationContext()) - .inflate(R.layout.download_manager_ui_space_widget, parent, false); + mViewContainer = LayoutInflater.from(ContextUtils.getApplicationContext()) + .inflate(R.layout.download_manager_ui_space_widget, parent, false); + mView = mViewContainer.findViewById(R.id.space_widget_content); mSpaceUsedByDownloadsTextView = (TextView) mView.findViewById(R.id.size_downloaded); mSpaceUsedByOtherAppsTextView = (TextView) mView.findViewById(R.id.size_other_apps); mSpaceFreeTextView = (TextView) mView.findViewById(R.id.size_free); @@ -125,6 +127,11 @@ new StorageSizeTask(true).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } + /** @return The view container of space display view. */ + public View getViewContainer() { + return mViewContainer; + } + /** Returns the view. */ public View getView() { return mView;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryAdapter.java index 13f7368..2122fb1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryAdapter.java
@@ -8,24 +8,23 @@ import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView.ViewHolder; import android.text.SpannableString; +import android.text.TextPaint; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.Button; -import android.widget.Space; import android.widget.TextView; +import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.VisibleForTesting; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.history.HistoryProvider.BrowsingHistoryObserver; import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.widget.DateDividedAdapter; -import org.chromium.chrome.browser.widget.displaystyle.MarginResizer; import org.chromium.chrome.browser.widget.selection.SelectableItemViewHolder; -import org.chromium.chrome.browser.widget.selection.SelectableListLayout; import org.chromium.chrome.browser.widget.selection.SelectionDelegate; import org.chromium.chrome.browser.widget.selection.SelectionDelegate.SelectionObserver; import org.chromium.components.signin.ChromeSigninController; @@ -56,7 +55,7 @@ private TextView mSignedInNotSyncedTextView; private TextView mSignedInSyncedTextView; private TextView mOtherFormsOfBrowsingHistoryTextView; - private Space mPrivacyDisclaimerBottomSpace; + private View mPrivacyDisclaimerBottomSpace; private Button mClearBrowsingDataButton; private HeaderItem mPrivacyDisclaimerHeaderItem; private HeaderItem mClearBrowsingDataButtonHeaderItem; @@ -181,12 +180,6 @@ */ public void removeItems() { mHistoryProvider.removeItems(); - - // TODO(twellington): this could be optimized by only setting the background for item views - // in a group that has changed. - for (HistoryItemView itemView : mItemViews) { - itemView.setBackgroundResourceForGroupPosition(); - } } /** @@ -220,7 +213,6 @@ SelectableItemViewHolder<HistoryItem> viewHolder = new SelectableItemViewHolder<>(v, mSelectionDelegate); HistoryItemView itemView = (HistoryItemView) viewHolder.itemView; - itemView.configureWideDisplayStyle(mHistoryManager.getSelectableListLayout().getUiConfig()); itemView.setRemoveButtonVisible(!mSelectionDelegate.isSelectionEnabled()); mItemViews.add(itemView); return viewHolder; @@ -253,7 +245,6 @@ mClearOnNextQueryComplete = false; } - boolean wasInitialized = mIsInitialized; if (!mIsInitialized) { if (items.size() > 0 && !mIsSearching) setHeaders(); mIsInitialized = true; @@ -261,23 +252,8 @@ removeFooter(); - HistoryItemView lastHistoryItemView = null; - if (mRecyclerView != null && wasInitialized) { - ViewHolder holder = mRecyclerView.findViewHolderForAdapterPosition(getItemCount() - 1); - if (holder instanceof SelectableItemViewHolder) { - lastHistoryItemView = - (HistoryItemView) ((SelectableItemViewHolder<HistoryItem>) holder).itemView; - } - } - loadItems(items); - if (lastHistoryItemView != null) { - // When loading more items, the last item's background needs to be reset since it may - // now be in the middle of an ItemGroup. - lastHistoryItemView.setBackgroundResourceForGroupPosition(); - } - mIsLoadingItems = false; mHasMorePotentialItems = hasMorePotentialMatches; if (items.size() > 0) { @@ -307,16 +283,6 @@ .inflate(R.layout.indeterminate_progress_view, parent, false)); } - @Override - protected DateViewHolder createDateViewHolder(ViewGroup parent) { - DateViewHolder viewHolder = super.createDateViewHolder(parent); - MarginResizer.createAndAttach(viewHolder.itemView, - mHistoryManager.getSelectableListLayout().getUiConfig(), - getDefaultTextMargin(parent.getResources()), - SelectableListLayout.getDefaultListItemLateralShadowSizePx(parent.getResources())); - return viewHolder; - } - /** * Initialize clear browsing data and privacy disclaimer header views and generate header * items for them. @@ -325,24 +291,15 @@ ViewGroup privacyDisclaimers = (ViewGroup) View.inflate(mHistoryManager.getSelectableListLayout().getContext(), R.layout.history_privacy_disclaimer_header, null); - Resources resources = privacyDisclaimers.getResources(); mSignedInNotSyncedTextView = (TextView) privacyDisclaimers.findViewById(R.id.signed_in_not_synced); setPrivacyDisclaimerText(mSignedInNotSyncedTextView, R.string.android_history_no_synced_results, LEARN_MORE_LINK); - MarginResizer.createAndAttach(mSignedInNotSyncedTextView, - mHistoryManager.getSelectableListLayout().getUiConfig(), - getDefaultTextMargin(resources), - SelectableListLayout.getDefaultListItemLateralShadowSizePx(resources)); mSignedInSyncedTextView = (TextView) privacyDisclaimers.findViewById(R.id.signed_in_synced); setPrivacyDisclaimerText(mSignedInSyncedTextView, R.string.android_history_has_synced_results, LEARN_MORE_LINK); - MarginResizer.createAndAttach(mSignedInSyncedTextView, - mHistoryManager.getSelectableListLayout().getUiConfig(), - getDefaultTextMargin(resources), - SelectableListLayout.getDefaultListItemLateralShadowSizePx(resources)); mOtherFormsOfBrowsingHistoryTextView = (TextView) privacyDisclaimers.findViewById(R.id.other_forms_of_browsing_history); @@ -352,13 +309,9 @@ String disclaimerUrl = flagEnabled ? MY_ACTIVITY_LINK : GOOGLE_HISTORY_LINK; setPrivacyDisclaimerText( mOtherFormsOfBrowsingHistoryTextView, disclaimerTextId, disclaimerUrl); - MarginResizer.createAndAttach(mOtherFormsOfBrowsingHistoryTextView, - mHistoryManager.getSelectableListLayout().getUiConfig(), - getDefaultTextMargin(resources), - SelectableListLayout.getDefaultListItemLateralShadowSizePx(resources)); mPrivacyDisclaimerBottomSpace = - (Space) privacyDisclaimers.findViewById(R.id.privacy_disclaimer_bottom_space); + privacyDisclaimers.findViewById(R.id.privacy_disclaimer_bottom_space); ViewGroup clearBrowsingDataButtonContainer = (ViewGroup) View.inflate(mHistoryManager.getSelectableListLayout().getContext(), @@ -372,9 +325,6 @@ mHistoryManager.openClearBrowsingDataPreference(); } }); - MarginResizer.createAndAttach(clearBrowsingDataButtonContainer, - mHistoryManager.getSelectableListLayout().getUiConfig(), - SelectableListLayout.getDefaultListItemLateralMarginPx(resources), 0); mPrivacyDisclaimerHeaderItem = new HeaderItem(0, privacyDisclaimers); mClearBrowsingDataButtonHeaderItem = new HeaderItem(1, clearBrowsingDataButtonContainer); @@ -392,12 +342,19 @@ setHeaders(args.toArray(new HeaderItem[args.size()])); } - private void setPrivacyDisclaimerText(TextView view, int stringId, final String url) { + private void setPrivacyDisclaimerText(final TextView view, int stringId, final String url) { NoUnderlineClickableSpan link = new NoUnderlineClickableSpan() { @Override public void onClick(View view) { mHistoryManager.openUrl(url, null, true); } + + @Override + public void updateDrawState(TextPaint textPaint) { + super.updateDrawState(textPaint); + textPaint.setColor(ApiCompatibilityUtils.getColor( + view.getResources(), R.color.google_blue_700)); + } }; SpannableString spannable = SpanApplier.applySpans( view.getResources().getString(stringId),
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java index f22b0bb..bef128a6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java
@@ -57,7 +57,7 @@ mIconGenerator = new RoundedIconGenerator(mDisplayedIconSize , mDisplayedIconSize, mCornerRadius, iconColor, textSize); mEndPadding = context.getResources().getDimensionPixelSize( - R.dimen.selectable_list_layout_row_end_padding); + R.dimen.selectable_list_layout_row_padding); } @Override @@ -80,13 +80,7 @@ @Override public void setItem(HistoryItem item) { - if (getItem() == item) { - // If the item is being set again, it means the HistoryAdapter contents have likely - // changed. This item may have changed group positions, so the background should be - // updated. - setBackgroundResourceForGroupPosition(); - return; - } + if (getItem() == item) return; super.setItem(item); @@ -110,8 +104,6 @@ mTitle.setTextColor( ApiCompatibilityUtils.getColor(getResources(), R.color.default_text_color)); } - - setBackgroundResourceForGroupPosition(); } /** @@ -195,12 +187,4 @@ ApiCompatibilityUtils.getPaddingStart(mContentView), mContentView.getPaddingTop(), endPadding, mContentView.getPaddingBottom()); } - - /** - * Sets the background resource for this view using the item's positioning in its group. - */ - public void setBackgroundResourceForGroupPosition() { - setBackgroundResourceForGroupPosition( - getItem().isFirstInGroup(), getItem().isLastInGroup()); - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java index e0c7b32f..04e5d575 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java
@@ -109,8 +109,8 @@ // 3. Initialize toolbar. mToolbar = (HistoryManagerToolbar) mSelectableListLayout.initializeToolbar( R.layout.history_toolbar, mSelectionDelegate, R.string.menu_history, null, - R.id.normal_menu_group, R.id.selection_mode_menu_group, - R.color.default_primary_color, this, true); + R.id.normal_menu_group, R.id.selection_mode_menu_group, R.color.modern_toolbar_bg, + this, true); mToolbar.setManager(this); mToolbar.initializeSearchView(this, R.string.history_manager_search, R.id.search_menu_id); mToolbar.setInfoMenuItem(R.id.info_menu_id);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistorySheetContent.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistorySheetContent.java index fec7ffd3..ece6a2b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistorySheetContent.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistorySheetContent.java
@@ -86,6 +86,6 @@ @Override public boolean applyDefaultTopPadding() { - return true; + return false; } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/ReaderModeInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/ReaderModeInfoBar.java index 3167998..5b4e138 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/ReaderModeInfoBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/ReaderModeInfoBar.java
@@ -25,13 +25,17 @@ * {@link OverlayPanel} implementation when Chrome Home is enabled. */ public class ReaderModeInfoBar extends InfoBar { + /** If the infobar has started hiding. */ + private boolean mIsHiding; + /** * Navigate to Reader Mode when the icon or the message text is clicked. */ private View.OnClickListener mNavigateListener = new View.OnClickListener() { @Override public void onClick(View v) { - if (getReaderModeManager() != null) getReaderModeManager().activateReaderMode(); + if (getReaderModeManager() == null || mIsHiding) return; + getReaderModeManager().activateReaderMode(); } }; @@ -48,6 +52,11 @@ } @Override + protected void onStartedHiding() { + mIsHiding = true; + } + + @Override protected void createCompactLayoutContent(InfoBarCompactLayout layout) { TextView prompt = new TextView(getContext()); prompt.setText(R.string.reader_view_text);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java index 319d23d..44a732d3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
@@ -9,6 +9,7 @@ import android.content.res.Resources; import android.util.AttributeSet; import android.util.TypedValue; +import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; @@ -18,6 +19,7 @@ import org.chromium.chrome.browser.ntp.cards.CardsVariationParameters; import org.chromium.chrome.browser.ntp.cards.NewTabPageRecyclerView; import org.chromium.chrome.browser.ntp.snippets.SnippetsConfig; +import org.chromium.chrome.browser.suggestions.SuggestionsConfig; import org.chromium.chrome.browser.suggestions.TileGridLayout; /** @@ -90,7 +92,19 @@ mSearchBoxSpacer = findViewById(R.id.search_box_spacer); mSearchProviderLogoView = findViewById(R.id.search_provider_logo); mSearchBoxView = findViewById(R.id.search_box); - mTileGridLayout = findViewById(R.id.tile_grid_layout); + insertSiteSectionView(); + } + + private void insertSiteSectionView() { + // TODO(galinap): load the explore UI when needed. + assert !SuggestionsConfig.useSitesExplorationUi(); + + LayoutInflater inflater = LayoutInflater.from(getContext()); + mTileGridLayout = + (TileGridLayout) inflater.inflate(R.layout.suggestions_site_tile_grid, this, false); + + int insertionPoint = indexOfChild(mMiddleSpacer) + 1; + addView(mTileGridLayout, insertionPoint); } /** @@ -105,6 +119,10 @@ mParentViewportHeight = height; } + public TileGridLayout getTileGroupLayout() { + return mTileGridLayout; + } + @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { calculateVerticalSpacing(widthMeasureSpec, heightMeasureSpec);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java index e4558ef3..0216543 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
@@ -46,8 +46,9 @@ import org.chromium.chrome.browser.suggestions.SuggestionsConfig; import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate; import org.chromium.chrome.browser.suggestions.Tile; -import org.chromium.chrome.browser.suggestions.TileGridLayout; +import org.chromium.chrome.browser.suggestions.TileGridViewHolder; import org.chromium.chrome.browser.suggestions.TileGroup; +import org.chromium.chrome.browser.suggestions.TileRenderer; import org.chromium.chrome.browser.suggestions.TileView; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.util.FeatureUtilities; @@ -91,7 +92,7 @@ private LogoView mSearchProviderLogoView; private View mSearchBoxView; private ImageView mVoiceSearchButton; - private TileGridLayout mTileGridLayout; + private TileGridViewHolder mSiteSectionView; private View mTileGridPlaceholder; private View mNoSearchLogoSpacer; @@ -252,13 +253,15 @@ Profile profile = Profile.getLastUsedProfile(); OfflinePageBridge offlinePageBridge = OfflinePageBridge.getForProfile(profile); + TileRenderer tileRenderer = + new TileRenderer(mActivity, SuggestionsConfig.getTileStyle(mUiConfig), + getTileTitleLines(), mManager.getImageFetcher()); + mTileGroup = new TileGroup(tileRenderer, mManager, mContextMenuManager, tileGroupDelegate, + /* observer = */ this, offlinePageBridge); - mTileGridLayout = mNewTabPageLayout.findViewById(R.id.tile_grid_layout); - mTileGridLayout.setMaxRows(getMaxTileRows(searchProviderHasLogo)); - mTileGridLayout.setMaxColumns(getMaxTileColumns()); - mTileGroup = new TileGroup(mActivity, mManager, mContextMenuManager, tileGroupDelegate, - /* observer = */ this, offlinePageBridge, getTileTitleLines(), - SuggestionsConfig.getTileStyle(mUiConfig)); + mSiteSectionView = new TileGridViewHolder(mNewTabPageLayout.getTileGroupLayout(), + getMaxTileRows(searchProviderHasLogo), getMaxTileColumns()); + mSiteSectionView.bindDataSource(mTileGroup, tileRenderer); mSearchProviderLogoView = mNewTabPageLayout.findViewById(R.id.search_provider_logo); int experimentalLogoHeightDp = ChromeFeatureList.getFieldTrialParamByFeatureAsInt( @@ -624,7 +627,8 @@ int paddingTop = getResources().getDimensionPixelSize(shouldShowLogo() ? R.dimen.tile_grid_layout_padding_top : R.dimen.tile_grid_layout_no_logo_padding_top); - mTileGridLayout.setPadding(0, paddingTop, 0, mTileGridLayout.getPaddingBottom()); + mSiteSectionView.itemView.setPadding( + 0, paddingTop, 0, mSiteSectionView.itemView.getPaddingBottom()); // Hide or show the views above the tile grid as needed, including logo, search box, and // spacers. @@ -633,7 +637,7 @@ int childCount = mNewTabPageLayout.getChildCount(); for (int i = 0; i < childCount; i++) { View child = mNewTabPageLayout.getChildAt(i); - if (child == mTileGridLayout) break; + if (child == mSiteSectionView.itemView) break; // Don't change the visibility of a ViewStub as that will automagically inflate it. if (child instanceof ViewStub) continue; if (child == mSearchProviderLogoView) { @@ -845,23 +849,22 @@ * items and there is no search provider logo. */ private void updateTileGridPlaceholderVisibility() { - boolean showPlaceholder = mTileGroup.hasReceivedData() && mTileGroup.getAllTiles().isEmpty() - && !mSearchProviderHasLogo; + boolean showPlaceholder = + mTileGroup.hasReceivedData() && mTileGroup.isEmpty() && !mSearchProviderHasLogo; mNoSearchLogoSpacer.setVisibility( (mSearchProviderHasLogo || showPlaceholder) ? View.GONE : View.INVISIBLE); + mSiteSectionView.itemView.setVisibility(showPlaceholder ? GONE : VISIBLE); + if (showPlaceholder) { if (mTileGridPlaceholder == null) { ViewStub placeholderStub = - (ViewStub) mNewTabPageLayout.findViewById(R.id.tile_grid_placeholder_stub); - + mNewTabPageLayout.findViewById(R.id.tile_grid_placeholder_stub); mTileGridPlaceholder = placeholderStub.inflate(); } - mTileGridLayout.setVisibility(GONE); mTileGridPlaceholder.setVisibility(VISIBLE); } else if (mTileGridPlaceholder != null) { - mTileGridLayout.setVisibility(VISIBLE); mTileGridPlaceholder.setVisibility(GONE); } } @@ -930,7 +933,7 @@ @Override public void onTileDataChanged() { - mTileGroup.renderTiles(mTileGridLayout); + mSiteSectionView.refreshData(); mSnapshotTileGridChanged = true; // The page contents are initially hidden; otherwise they'll be drawn centered on the page @@ -951,13 +954,13 @@ @Override public void onTileIconChanged(Tile tile) { - mTileGridLayout.updateIconView(tile); + mSiteSectionView.updateIconView(tile); mSnapshotTileGridChanged = true; } @Override public void onTileOfflineBadgeVisibilityChanged(Tile tile) { - mTileGridLayout.updateOfflineBadge(tile); + mSiteSectionView.updateOfflineBadge(tile); mSnapshotTileGridChanged = true; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardViewHolder.java index 89c703e..14cb9d3e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardViewHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardViewHolder.java
@@ -324,7 +324,7 @@ case ItemViewType.PROMO: return true; case ItemViewType.ABOVE_THE_FOLD: - case ItemViewType.TILE_GRID: + case ItemViewType.SITE_SECTION: case ItemViewType.HEADER: case ItemViewType.SPACING: case ItemViewType.PROGRESS:
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ItemViewType.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ItemViewType.java index 31f84c7e..6a99b62 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ItemViewType.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ItemViewType.java
@@ -17,7 +17,7 @@ * * @see Adapter#getItemViewType(int) */ -@IntDef({ItemViewType.ABOVE_THE_FOLD, ItemViewType.TILE_GRID, ItemViewType.HEADER, +@IntDef({ItemViewType.ABOVE_THE_FOLD, ItemViewType.SITE_SECTION, ItemViewType.HEADER, ItemViewType.SNIPPET, ItemViewType.SPACING, ItemViewType.STATUS, ItemViewType.PROGRESS, ItemViewType.ACTION, ItemViewType.FOOTER, ItemViewType.PROMO, ItemViewType.ALL_DISMISSED, ItemViewType.CAROUSEL}) @@ -30,11 +30,11 @@ */ int ABOVE_THE_FOLD = 1; /** - * View type for a {@code TileGrid}. + * View type for a {@code SiteSection}. * * @see Adapter#getItemViewType(int) */ - int TILE_GRID = 2; + int SITE_SECTION = 2; /** * View type for card group headers *
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java index d0dc718..68aa869 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
@@ -23,11 +23,11 @@ import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; import org.chromium.chrome.browser.suggestions.DestructionObserver; +import org.chromium.chrome.browser.suggestions.SiteSection; import org.chromium.chrome.browser.suggestions.SuggestionsCarousel; import org.chromium.chrome.browser.suggestions.SuggestionsConfig; import org.chromium.chrome.browser.suggestions.SuggestionsRecyclerView; import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate; -import org.chromium.chrome.browser.suggestions.TileGrid; import org.chromium.chrome.browser.suggestions.TileGroup; import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.widget.displaystyle.UiConfig; @@ -55,7 +55,7 @@ @Nullable private final AboveTheFoldItem mAboveTheFold; @Nullable - private final TileGrid mTileGrid; + private final SiteSection mSiteSection; private final SuggestionsCarousel mSuggestionsCarousel; private final SectionList mSections; private final SignInPromo mSigninPromo; @@ -72,7 +72,7 @@ * @param uiConfig the NTP UI configuration, to be passed to created views. * @param offlinePageBridge used to determine if articles are available. * @param contextMenuManager used to build context menus. - * @param tileGroupDelegate if not null this is used to build a {@link TileGrid}. + * @param tileGroupDelegate if not null this is used to build a {@link SiteSection}. * @param suggestionsCarousel if not null this is used to build a carousel showing contextual * suggestions. */ @@ -106,11 +106,11 @@ } if (tileGroupDelegate == null) { - mTileGrid = null; + mSiteSection = null; } else { - mTileGrid = new TileGrid(uiDelegate, mContextMenuManager, tileGroupDelegate, + mSiteSection = new SiteSection(uiDelegate, mContextMenuManager, tileGroupDelegate, offlinePageBridge, uiConfig); - mRoot.addChild(mTileGrid); + mRoot.addChild(mSiteSection); } if (SuggestionsConfig.useModern()) { @@ -148,8 +148,8 @@ case ItemViewType.ABOVE_THE_FOLD: return new NewTabPageViewHolder(mAboveTheFoldView); - case ItemViewType.TILE_GRID: - return new TileGrid.ViewHolder(mRecyclerView); + case ItemViewType.SITE_SECTION: + return SiteSection.createViewHolder(parent); case ItemViewType.HEADER: return new SectionHeaderViewHolder(mRecyclerView, mUiConfig); @@ -219,8 +219,8 @@ mSections.refreshSuggestions(); } - if (mTileGrid != null) { - mTileGrid.getTileGroup().onSwitchToForeground(/* trackLoadTasks = */ true); + if (mSiteSection != null) { + mSiteSection.getTileGroup().onSwitchToForeground(/* trackLoadTasks = */ true); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SiteSection.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SiteSection.java new file mode 100644 index 0000000..4811880 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SiteSection.java
@@ -0,0 +1,122 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.suggestions; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import org.chromium.base.ContextUtils; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.ntp.ContextMenuManager; +import org.chromium.chrome.browser.ntp.cards.ItemViewType; +import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder; +import org.chromium.chrome.browser.ntp.cards.NodeVisitor; +import org.chromium.chrome.browser.ntp.cards.OptionalLeaf; +import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; +import org.chromium.chrome.browser.widget.displaystyle.UiConfig; + +/** + * The model and controller for a group of site suggestions. + */ +public class SiteSection extends OptionalLeaf implements TileGroup.Observer { + /** + * The maximum number of tiles to try and fit in a row. On smaller screens, there may not be + * enough space to fit all of them. + */ + private static final int MAX_TILE_COLUMNS = 4; + + /** + * Experiment parameter for the maximum number of tile suggestion rows to show. + */ + private static final String PARAM_CHROME_HOME_MAX_TILE_ROWS = "chrome_home_max_tile_rows"; + + /** + * Experiment parameter for the number of tile title lines to show. + */ + private static final String PARAM_CHROME_HOME_TILE_TITLE_LINES = "chrome_home_tile_title_lines"; + + private final TileGroup mTileGroup; + private final TileRenderer mTileRenderer; + + public static TileGridViewHolder createViewHolder(ViewGroup parent) { + View view = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.suggestions_site_tile_grid, parent, false); + return new TileGridViewHolder((TileGridLayout) view, getMaxTileRows(), MAX_TILE_COLUMNS); + } + + public SiteSection(SuggestionsUiDelegate uiDelegate, ContextMenuManager contextMenuManager, + TileGroup.Delegate tileGroupDelegate, OfflinePageBridge offlinePageBridge, + UiConfig uiConfig) { + mTileRenderer = new TileRenderer(ContextUtils.getApplicationContext(), + SuggestionsConfig.getTileStyle(uiConfig), getTileTitleLines(), + uiDelegate.getImageFetcher()); + mTileGroup = new TileGroup(mTileRenderer, uiDelegate, contextMenuManager, tileGroupDelegate, + /* observer = */ this, offlinePageBridge); + mTileGroup.startObserving(getMaxTileRows() * MAX_TILE_COLUMNS); + } + + @Override + @ItemViewType + protected int getItemViewType() { + return ItemViewType.SITE_SECTION; + } + + @Override + protected void onBindViewHolder(NewTabPageViewHolder holder) { + assert holder instanceof TileGridViewHolder; + + SiteSectionView siteSectionView = (SiteSectionView) holder; + siteSectionView.bindDataSource(mTileGroup, mTileRenderer); + siteSectionView.refreshData(); + } + + @Override + protected void visitOptionalItem(NodeVisitor visitor) { + visitor.visitTileGrid(); + } + + @Override + public void onTileDataChanged() { + setVisibilityInternal(!mTileGroup.isEmpty()); + if (isVisible()) { + notifyItemChanged(0, new TileGridViewHolder.UpdateTilesCallback()); + } + } + + @Override + public void onTileCountChanged() { + onTileDataChanged(); + } + + @Override + public void onTileIconChanged(Tile tile) { + if (isVisible()) notifyItemChanged(0, new TileGridViewHolder.UpdateIconViewCallback(tile)); + } + + @Override + public void onTileOfflineBadgeVisibilityChanged(Tile tile) { + if (isVisible()) { + notifyItemChanged(0, new TileGridViewHolder.UpdateOfflineBadgeCallback(tile)); + } + } + + public TileGroup getTileGroup() { + return mTileGroup; + } + + private static int getMaxTileRows() { + int defaultValue = 2; + return ChromeFeatureList.getFieldTrialParamByFeatureAsInt( + ChromeFeatureList.CHROME_HOME, PARAM_CHROME_HOME_MAX_TILE_ROWS, defaultValue); + } + + private static int getTileTitleLines() { + int defaultValue = 1; + return ChromeFeatureList.getFieldTrialParamByFeatureAsInt( + ChromeFeatureList.CHROME_HOME, PARAM_CHROME_HOME_TILE_TITLE_LINES, defaultValue); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SiteSectionView.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SiteSectionView.java new file mode 100644 index 0000000..158ba617 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SiteSectionView.java
@@ -0,0 +1,23 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.suggestions; + +/** + * Describes a portion of UI responsible for rendering a group of sites. It abstracts general tasks + * related to initialising and updating this UI. + */ +interface SiteSectionView { + /** Initialise the view, letting it know the data it will have to display. */ + void bindDataSource(TileGroup tileGroup, TileRenderer tileRenderer); + + /** Clears the current data and displays the current state of the model. */ + void refreshData(); + + /** Updates the icon shown for the provided tile. */ + void updateIconView(Tile tile); + + /** Updates the offline badge for the provided tile. */ + void updateOfflineBadge(Tile tile); +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGrid.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGrid.java deleted file mode 100644 index 55723ff..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGrid.java +++ /dev/null
@@ -1,183 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.suggestions; - -import android.view.LayoutInflater; -import android.view.ViewGroup; - -import org.chromium.base.ContextUtils; -import org.chromium.chrome.R; -import org.chromium.chrome.browser.ChromeFeatureList; -import org.chromium.chrome.browser.ntp.ContextMenuManager; -import org.chromium.chrome.browser.ntp.cards.ItemViewType; -import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder; -import org.chromium.chrome.browser.ntp.cards.NodeVisitor; -import org.chromium.chrome.browser.ntp.cards.OptionalLeaf; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; -import org.chromium.chrome.browser.widget.displaystyle.UiConfig; - -/** - * The model and controller for a group of site suggestion tiles that will be rendered in a grid. - */ -public class TileGrid extends OptionalLeaf implements TileGroup.Observer { - /** - * The maximum number of tiles to try and fit in a row. On smaller screens, there may not be - * enough space to fit all of them. - */ - private static final int MAX_TILE_COLUMNS = 4; - - /** - * Experiment parameter for the maximum number of tile suggestion rows to show. - */ - private static final String PARAM_CHROME_HOME_MAX_TILE_ROWS = "chrome_home_max_tile_rows"; - - /** - * Experiment parameter for the number of tile title lines to show. - */ - private static final String PARAM_CHROME_HOME_TILE_TITLE_LINES = "chrome_home_tile_title_lines"; - - private final TileGroup mTileGroup; - - public TileGrid(SuggestionsUiDelegate uiDelegate, ContextMenuManager contextMenuManager, - TileGroup.Delegate tileGroupDelegate, OfflinePageBridge offlinePageBridge, - UiConfig uiConfig) { - mTileGroup = new TileGroup(ContextUtils.getApplicationContext(), uiDelegate, - contextMenuManager, tileGroupDelegate, /* observer = */ this, offlinePageBridge, - getTileTitleLines(), SuggestionsConfig.getTileStyle(uiConfig)); - mTileGroup.startObserving(getMaxTileRows() * MAX_TILE_COLUMNS); - } - - @Override - @ItemViewType - protected int getItemViewType() { - return ItemViewType.TILE_GRID; - } - - @Override - protected void onBindViewHolder(NewTabPageViewHolder holder) { - assert holder instanceof ViewHolder; - ((ViewHolder) holder).updateTiles(mTileGroup); - } - - @Override - protected void visitOptionalItem(NodeVisitor visitor) { - visitor.visitTileGrid(); - } - - @Override - public void onTileDataChanged() { - setVisibilityInternal(!mTileGroup.getAllTiles().isEmpty()); - if (isVisible()) notifyItemChanged(0, new ViewHolder.UpdateTilesCallback(mTileGroup)); - } - - @Override - public void onTileCountChanged() { - onTileDataChanged(); - } - - @Override - public void onTileIconChanged(Tile tile) { - if (isVisible()) notifyItemChanged(0, new ViewHolder.UpdateIconViewCallback(tile)); - } - - @Override - public void onTileOfflineBadgeVisibilityChanged(Tile tile) { - if (isVisible()) notifyItemChanged(0, new ViewHolder.UpdateOfflineBadgeCallback(tile)); - } - - public TileGroup getTileGroup() { - return mTileGroup; - } - - private static int getMaxTileRows() { - int defaultValue = 2; - return ChromeFeatureList.getFieldTrialParamByFeatureAsInt( - ChromeFeatureList.CHROME_HOME, PARAM_CHROME_HOME_MAX_TILE_ROWS, defaultValue); - } - - private static int getTileTitleLines() { - int defaultValue = 1; - return ChromeFeatureList.getFieldTrialParamByFeatureAsInt( - ChromeFeatureList.CHROME_HOME, PARAM_CHROME_HOME_TILE_TITLE_LINES, defaultValue); - } - - /** - * The {@code ViewHolder} for the {@link TileGrid}. - */ - public static class ViewHolder extends NewTabPageViewHolder { - private final TileGridLayout mLayout; - - public ViewHolder(ViewGroup parentView) { - super(LayoutInflater.from(parentView.getContext()) - .inflate(R.layout.suggestions_site_tile_grid, parentView, false)); - mLayout = (TileGridLayout) itemView; - mLayout.setMaxRows(getMaxTileRows()); - mLayout.setMaxColumns(MAX_TILE_COLUMNS); - } - - public void updateTiles(TileGroup tileGroup) { - tileGroup.renderTiles(mLayout); - } - - public void updateIconView(Tile tile) { - mLayout.updateIconView(tile); - } - - public void updateOfflineBadge(Tile tile) { - mLayout.updateOfflineBadge(tile); - } - - /** - * Callback to update all the tiles in the view holder. - */ - public static class UpdateTilesCallback extends PartialBindCallback { - private final TileGroup mTileGroup; - - public UpdateTilesCallback(TileGroup tileGroup) { - mTileGroup = tileGroup; - } - - @Override - public void onResult(NewTabPageViewHolder holder) { - assert holder instanceof ViewHolder; - ((ViewHolder) holder).updateTiles(mTileGroup); - } - } - - /** - * Callback to update the icon view for the view holder. - */ - public static class UpdateIconViewCallback extends PartialBindCallback { - private final Tile mTile; - - public UpdateIconViewCallback(Tile tile) { - mTile = tile; - } - - @Override - public void onResult(NewTabPageViewHolder holder) { - assert holder instanceof ViewHolder; - ((ViewHolder) holder).updateIconView(mTile); - } - } - - /** - * Callback to update the offline badge for the view holder. - */ - public static class UpdateOfflineBadgeCallback extends PartialBindCallback { - private final Tile mTile; - - public UpdateOfflineBadgeCallback(Tile tile) { - mTile = tile; - } - - @Override - public void onResult(NewTabPageViewHolder holder) { - assert holder instanceof ViewHolder; - ((ViewHolder) holder).updateOfflineBadge(mTile); - } - } - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGridLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGridLayout.java index 96f2c3c..1a710868 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGridLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGridLayout.java
@@ -6,12 +6,12 @@ import android.content.Context; import android.content.res.Resources; +import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.View; import android.widget.FrameLayout; import org.chromium.base.ApiCompatibilityUtils; -import org.chromium.base.VisibleForTesting; import org.chromium.chrome.R; import org.chromium.chrome.browser.util.MathUtils; @@ -80,24 +80,6 @@ forceLayout(); } - /** - * Sets a new icon on the child view with a matching URL. - * @param tile The tile that holds the data to populate the tile view. - */ - public void updateIconView(Tile tile) { - TileView tileView = getTileView(tile.getData()); - if (tileView != null) tileView.renderIcon(tile); - } - - /** - * Updates the visibility of the offline badge on the child view with a matching URL. - * @param tile The tile that holds the data to populate the tile view. - */ - public void updateOfflineBadge(Tile tile) { - TileView tileView = getTileView(tile.getData()); - if (tileView != null) tileView.renderOfflineBadge(tile); - } - @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int totalWidth = resolveSize(mMaxWidth, widthMeasureSpec); @@ -198,9 +180,8 @@ return orderedChildren; } - /** @return A tile view associated to the provided data, or {@code null} if none is found. */ - @VisibleForTesting - TileView getTileView(SiteSuggestion suggestion) { + @Nullable + public TileView getTileView(SiteSuggestion suggestion) { int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { TileView tileView = (TileView) getChildAt(i);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGridViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGridViewHolder.java new file mode 100644 index 0000000..befee3a7 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGridViewHolder.java
@@ -0,0 +1,109 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.suggestions; + +import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder; + +import java.util.List; + +/** + * A {@link SiteSectionView} specialised in displaying sites as a simple grid of tiles, through + * {@link TileGridLayout}. + */ +public class TileGridViewHolder extends NewTabPageViewHolder implements SiteSectionView { + private final TileGridLayout mSectionView; + + private TileGroup mTileGroup; + private TileRenderer mTileRenderer; + + public TileGridViewHolder(TileGridLayout tileGridLayout, int maxRows, int maxColumns) { + super(tileGridLayout); + + mSectionView = tileGridLayout; + mSectionView.setMaxRows(maxRows); + mSectionView.setMaxColumns(maxColumns); + } + + @Override + public void bindDataSource(TileGroup tileGroup, TileRenderer tileRenderer) { + mTileGroup = tileGroup; + mTileRenderer = tileRenderer; + } + + @Override + public void refreshData() { + assert mTileGroup.getTiles().size() == 1; + List<Tile> tiles = mTileGroup.getTiles().get(TileSectionType.PERSONALIZED); + assert tiles != null; + + mTileRenderer.renderTileSection(tiles, mSectionView, mTileGroup.getTileSetupDelegate()); + mTileGroup.notifyTilesRendered(); + } + + /** + * Sets a new icon on the child view with a matching site. + * @param tile The tile that holds the data to populate the tile view. + */ + @Override + public void updateIconView(Tile tile) { + TileView tileView = mSectionView.getTileView(tile.getData()); + if (tileView != null) tileView.renderIcon(tile); + } + + /** + * Updates the visibility of the offline badge on the child view with a matching site. + * @param tile The tile that holds the data to populate the tile view. + */ + @Override + public void updateOfflineBadge(Tile tile) { + TileView tileView = mSectionView.getTileView(tile.getData()); + if (tileView != null) tileView.renderOfflineBadge(tile); + } + + /** + * Callback to update all the tiles in the view holder. + */ + public static class UpdateTilesCallback extends PartialBindCallback { + @Override + public void onResult(NewTabPageViewHolder holder) { + assert holder instanceof TileGridViewHolder; + ((SiteSectionView) holder).refreshData(); + } + } + + /** + * Callback to update the icon view for the view holder. + */ + public static class UpdateIconViewCallback extends PartialBindCallback { + private final Tile mTile; + + public UpdateIconViewCallback(Tile tile) { + mTile = tile; + } + + @Override + public void onResult(NewTabPageViewHolder holder) { + assert holder instanceof TileGridViewHolder; + ((SiteSectionView) holder).updateIconView(mTile); + } + } + + /** + * Callback to update the offline badge for the view holder. + */ + public static class UpdateOfflineBadgeCallback extends PartialBindCallback { + private final Tile mTile; + + public UpdateOfflineBadgeCallback(Tile tile) { + mTile = tile; + } + + @Override + public void onResult(NewTabPageViewHolder holder) { + assert holder instanceof TileGridViewHolder; + ((SiteSectionView) holder).updateOfflineBadge(mTile); + } + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGroup.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGroup.java index 9a98f64..24d571c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGroup.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGroup.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.suggestions; -import android.content.Context; import android.graphics.Bitmap; import android.support.annotation.IntDef; import android.support.annotation.Nullable; @@ -14,7 +13,6 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnCreateContextMenuListener; -import android.view.ViewGroup; import org.chromium.base.Callback; import org.chromium.base.VisibleForTesting; @@ -210,23 +208,21 @@ }; /** - * @param context Used for initialisation and resolving resources. + * @param tileRenderer Used to render icons. * @param uiDelegate Delegate used to interact with the rest of the system. * @param contextMenuManager Used to handle context menu invocations on the tiles. * @param tileGroupDelegate Used for interactions with the Most Visited backend. * @param observer Will be notified of changes to the tile data. - * @param titleLines The number of text lines to use for each tile title. - * @param tileStyle The style to use when building the tiles. See {@link TileView.Style}. + * @param offlinePageBridge Used to update the offline badge of the tiles. */ - public TileGroup(Context context, SuggestionsUiDelegate uiDelegate, + public TileGroup(TileRenderer tileRenderer, SuggestionsUiDelegate uiDelegate, ContextMenuManager contextMenuManager, Delegate tileGroupDelegate, Observer observer, - OfflinePageBridge offlinePageBridge, int titleLines, @TileView.Style int tileStyle) { + OfflinePageBridge offlinePageBridge) { mUiDelegate = uiDelegate; mContextMenuManager = contextMenuManager; mTileGroupDelegate = tileGroupDelegate; mObserver = observer; - mTileRenderer = - new TileRenderer(context, tileStyle, titleLines, uiDelegate.getImageFetcher()); + mTileRenderer = tileRenderer; if (ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_OFFLINE_PAGES_FEATURE_NAME)) { mOfflineModelObserver = new OfflineModelObserver(offlinePageBridge); @@ -286,32 +282,32 @@ } /** - * Renders tile views in the given {@link TileGridLayout}. - * @param parent The layout to render the tile views into. + * Method to be called when a tile render has been triggered, to let the {@link TileGroup} + * update its internal task tracking status. + * @see Delegate#onLoadingComplete(List) */ - public void renderTiles(ViewGroup parent) { - // TODO(dgn, galinap): Support extra sections in the UI. - assert mTileSections.size() == 1; - assert mTileSections.keyAt(0) == TileSectionType.PERSONALIZED; - - for (int i = 0; i < mTileSections.size(); ++i) { - mTileRenderer.renderTileSection(mTileSections.valueAt(i), parent, mTileSetupDelegate); - } + public void notifyTilesRendered() { // Icon fetch scheduling was done when building the tile views. if (isLoadTracked()) removeTask(TileTask.SCHEDULE_ICON_FETCH); } - /** @return All the tiles currently loaded in the group. */ - public List<Tile> getAllTiles() { - List<Tile> tiles = new ArrayList<>(); - for (int i = 0; i < mTileSections.size(); ++i) tiles.addAll(mTileSections.valueAt(i)); - return tiles; + /** @return the sites currently loaded in the group, grouped by vertical. */ + public SparseArray<List<Tile>> getTiles() { + return mTileSections; } public boolean hasReceivedData() { return mHasReceivedData; } + /** @return Whether the group has no sites to display. */ + public boolean isEmpty() { + for (int i = 0; i < mTileSections.size(); i++) { + if (!mTileSections.valueAt(i).isEmpty()) return false; + } + return true; + } + /** * To be called when the view displaying the tile group becomes visible. * @param trackLoadTask whether the delegate should be notified that the load is completed @@ -447,11 +443,6 @@ } @VisibleForTesting - TileRenderer getTileRenderer() { - return mTileRenderer; - } - - @VisibleForTesting TileSetupDelegate getTileSetupDelegate() { return mTileSetupDelegate; } @@ -463,7 +454,7 @@ // Have an empty list for now that can be rendered as-is without causing issues or too much // state checking. We will have to decide if we want empty lists or no section at all for // the others. - newTileData.put(TileSectionType.PERSONALIZED, new ArrayList<Tile>()); + newTileData.put(TileSectionType.PERSONALIZED, new ArrayList<>()); return newTileData; } @@ -581,7 +572,9 @@ @Override public Iterable<Tile> getOfflinableSuggestions() { - return getAllTiles(); + List<Tile> tiles = new ArrayList<>(); + for (int i = 0; i < mTileSections.size(); ++i) tiles.addAll(mTileSections.valueAt(i)); + return tiles; } } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java index 3e440d0..b2b2d68 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java
@@ -163,6 +163,8 @@ } private void recordErrorInPolicyAuditor(String failingUrl, String description, int errorCode) { + assert description != null; + PolicyAuditor auditor = AppHooks.get().getPolicyAuditor(); auditor.notifyAuditEvent(mTab.getApplicationContext(), AuditEvent.OPEN_URL_FAILURE, failingUrl, description);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java index df80cfe..782bb3ae 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
@@ -816,8 +816,7 @@ int extraTopMargin = getExtraTopMargin(); otherToolbar.setMinimumHeight(getHeight() - extraTopMargin); - otherToolbar.setTitleTextAppearance( - otherToolbar.getContext(), R.style.BottomSheetContentTitle); + otherToolbar.setTitleTextAppearance(otherToolbar.getContext(), R.style.BlackHeadline1); ApiCompatibilityUtils.setPaddingRelative(otherToolbar, ApiCompatibilityUtils.getPaddingStart(otherToolbar), otherToolbar.getPaddingTop() + extraTopMargin,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java index 9e94bb31..4ddf8a9d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java
@@ -175,8 +175,8 @@ } } builder.append(DateUtils.formatDateTime(mTextView.getContext(), date.getTime(), - DateUtils.FORMAT_SHOW_WEEKDAY | DateUtils.FORMAT_SHOW_DATE - | DateUtils.FORMAT_SHOW_YEAR)); + DateUtils.FORMAT_ABBREV_WEEKDAY | DateUtils.FORMAT_ABBREV_MONTH + | DateUtils.FORMAT_SHOW_YEAR)); mTextView.setText(builder); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableItemView.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableItemView.java index f226df58..aca2298 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableItemView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableItemView.java
@@ -13,9 +13,6 @@ import android.widget.FrameLayout; import org.chromium.chrome.R; -import org.chromium.chrome.browser.widget.displaystyle.HorizontalDisplayStyle; -import org.chromium.chrome.browser.widget.displaystyle.MarginResizer; -import org.chromium.chrome.browser.widget.displaystyle.UiConfig; import org.chromium.chrome.browser.widget.selection.SelectionDelegate.SelectionObserver; import java.util.List; @@ -63,19 +60,6 @@ } /** - * Sets the lateral margins used in {@link HorizontalDisplayStyle#WIDE} and - * {@link HorizontalDisplayStyle#REGULAR}. This should be called when the item uses the - * list_item* 9-patches as a background and the SelectableListLayout that contains the item - * is width constrained. - * - * @param uiConfig The UiConfig used to observe display style changes. - */ - public void configureWideDisplayStyle(UiConfig uiConfig) { - MarginResizer.createAndAttach(this, uiConfig, - SelectableListLayout.getDefaultListItemLateralMarginPx(getResources()), 0); - } - - /** * @param item The item associated with this SelectableItemView. */ public void setItem(E item) { @@ -182,26 +166,4 @@ * that case. */ protected abstract void onClick(); - - /** - * Sets the background resource for this view using the item's positioning in its group. - * @param isFirstInGroup Whether this item is the first in its group. - * @param isLastInGroup Whether this item is the last in its group. - */ - public void setBackgroundResourceForGroupPosition( - boolean isFirstInGroup, boolean isLastInGroup) { - int backgroundResource; - - if (!isLastInGroup && !isFirstInGroup) { - backgroundResource = R.drawable.list_item_middle; - } else if (!isLastInGroup) { - backgroundResource = R.drawable.list_item_top; - } else if (!isFirstInGroup) { - backgroundResource = R.drawable.list_item_bottom; - } else { - backgroundResource = R.drawable.list_item_single; - } - - setBackgroundResource(backgroundResource); - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListLayout.java index 1806bdb..2232e38 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListLayout.java
@@ -7,7 +7,6 @@ import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; -import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.support.annotation.VisibleForTesting; import android.support.v4.widget.DrawerLayout; @@ -53,52 +52,9 @@ */ public class SelectableListLayout<E> extends FrameLayout implements DisplayStyleObserver, SelectionObserver<E> { - /** - * @param res Resources used to retrieve drawables and dimensions. - * @return The default list item lateral margin size in pixels. This value should be used in - * {@link HorizontalDisplayStyle#REGULAR} to hide the lateral shadow and rounded edges - * on items that use the list_item* 9-patches as a background. - */ - public static int getDefaultListItemLateralMarginPx(Resources res) { - if (sDefaultListItemLateralMarginPx == -1) { - int cardCornerRadius = res.getDimensionPixelSize(R.dimen.list_item_corner_radius); - - // A negative margin is used in HorizontalDisplayStyle#REGULAR to hide the lateral - // shadow. - sDefaultListItemLateralMarginPx = - -(getDefaultListItemLateralShadowSizePx(res) + cardCornerRadius); - } - - return sDefaultListItemLateralMarginPx; - } - - /** - * Returns the list_item* 9-patch shadow size for use in {@link HorizontalDisplayStyle#WIDE} to - * align items that don't use the list_item* 9-patches as a background with items that do. - * - * @param res Resources used to retrieve drawables and dimensions. - * @return The default list item shadow size in pixels. - */ - public static int getDefaultListItemLateralShadowSizePx(Resources res) { - if (sDefaultListItemLateralShadowSizePx == -1) { - // Retrieve the size of the nine-patch shadow from the drawable's padding. - Rect listItemShadow = new Rect(); - ApiCompatibilityUtils.getDrawable(res, R.drawable.card_middle) - .getPadding(listItemShadow); - - assert listItemShadow.left == listItemShadow.right; - - sDefaultListItemLateralShadowSizePx = listItemShadow.left; - } - - return sDefaultListItemLateralShadowSizePx; - } private static final int WIDE_DISPLAY_MIN_PADDING_DP = 16; - private static int sDefaultListItemLateralMarginPx = -1; - private static int sDefaultListItemLateralShadowSizePx = -1; - private Adapter<RecyclerView.ViewHolder> mAdapter; private ViewStub mToolbarStub; private TextView mEmptyView; @@ -286,27 +242,16 @@ } /** - * Calls {@link #configureWideDisplayStyle(int)} using the default list item lateral shadow - * defined by {@link #getDefaultListItemLateralShadowSizePx(Resources)}. - */ - public void configureWideDisplayStyle() { - configureWideDisplayStyle(getDefaultListItemLateralShadowSizePx(getResources())); - } - - /** * When this layout has a wide display style, it will be width constrained to * {@link UiConfig#WIDE_DISPLAY_STYLE_MIN_WIDTH_DP}. If the current screen width is greater than * UiConfig#WIDE_DISPLAY_STYLE_MIN_WIDTH_DP, the SelectableListLayout will be visually centered * by adding padding to both sides. * * This method should be called after the toolbar and RecyclerView are initialized. - * - * @param wideDisplayToolbarLateralOffsetPx The offset to use for the toolbar's lateral padding - * when in {@link HorizontalDisplayStyle#WIDE}. */ - public void configureWideDisplayStyle(int wideDisplayToolbarLateralOffsetPx) { + public void configureWideDisplayStyle() { mUiConfig = new UiConfig(this); - mToolbar.configureWideDisplayStyle(wideDisplayToolbarLateralOffsetPx, mUiConfig); + mToolbar.configureWideDisplayStyle(mUiConfig); mUiConfig.addObserver(this); } @@ -340,10 +285,7 @@ public SelectableListToolbar<E> detachToolbarView() { removeView(mToolbar); - // The top margin for the content and shadow needs to be removed now that the toolbar - // has been removed. - View content = findViewById(R.id.list_content); - ((MarginLayoutParams) content.getLayoutParams()).topMargin = 0; + // The top margin for shadow needs to be removed now that the toolbar has been removed. ((MarginLayoutParams) mToolbarShadow.getLayoutParams()).topMargin = 0; return mToolbar;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListToolbar.java index bbee5f09..d1159a8c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListToolbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListToolbar.java
@@ -132,14 +132,7 @@ private int mSearchBackgroundColor; private UiConfig mUiConfig; - private int mDefaultTitleMarginStartPx; - private int mWideDisplayLateralOffsetPx; - private int mWideDisplayEndOffsetPx; - private int mWideDisplayNavButtonOffsetPx; - private int mOriginalContentInsetStart; - private int mOriginalContentInsetEnd; - private int mOriginalContentInsetStartWithNavigation; - private int mOriginalContentInsetEndWithActions; + private int mWideDisplayStartOffsetPx; private boolean mIsDestroyed; @@ -262,11 +255,6 @@ LayoutInflater.from(getContext()).inflate(R.layout.number_roll_view, this); mNumberRollView = (NumberRollView) findViewById(R.id.selection_mode_number); mNumberRollView.setString(R.plurals.selected_items); - - mOriginalContentInsetStart = getContentInsetStart(); - mOriginalContentInsetEnd = getContentInsetEnd(); - mOriginalContentInsetStartWithNavigation = getContentInsetStartWithNavigation(); - mOriginalContentInsetEndWithActions = getContentInsetEndWithActions(); } @Override @@ -458,17 +446,11 @@ * UiConfig#WIDE_DISPLAY_STYLE_MIN_WIDTH_DP, the toolbar contents will be visually centered by * adding padding to both sides. * - * @param wideDisplayLateralOffsetPx The offset to use for the lateral padding when in - * {@link HorizontalDisplayStyle#WIDE}. * @param uiConfig The UiConfig used to observe display style changes. */ - public void configureWideDisplayStyle(int wideDisplayLateralOffsetPx, UiConfig uiConfig) { - mWideDisplayLateralOffsetPx = wideDisplayLateralOffsetPx; - mDefaultTitleMarginStartPx = getTitleMarginStart(); - mWideDisplayNavButtonOffsetPx = - getResources().getDimensionPixelSize(R.dimen.toolbar_wide_display_nav_icon_offset); - mWideDisplayEndOffsetPx = getResources().getDimensionPixelSize( - R.dimen.toolbar_wide_display_end_offset); + public void configureWideDisplayStyle(UiConfig uiConfig) { + mWideDisplayStartOffsetPx = + getResources().getDimensionPixelSize(R.dimen.toolbar_wide_display_start_offset); mUiConfig = uiConfig; mUiConfig.addObserver(this); @@ -480,40 +462,16 @@ int padding = SelectableListLayout.getPaddingForDisplayStyle(newDisplayStyle, getResources()); int paddingStartOffset = 0; - int paddingEndOffset = 0; - int contentInsetStart = mOriginalContentInsetStart; - int contentInsetStartWithNavigation = mOriginalContentInsetStartWithNavigation; - int contentInsetEnd = mOriginalContentInsetEnd; - int contentInsetEndWithActions = mOriginalContentInsetEndWithActions; - if (newDisplayStyle.horizontal == HorizontalDisplayStyle.WIDE) { - paddingStartOffset = mWideDisplayLateralOffsetPx; - - // The title and nav buttons are inset in the normal display style. In the wide display - // style they should be aligned with the starting edge of the list elements. - if (mIsSearching || mIsSelectionEnabled - || mNavigationButton != NAVIGATION_BUTTON_NONE) { - paddingStartOffset += mWideDisplayNavButtonOffsetPx; - } else { - paddingStartOffset -= mDefaultTitleMarginStartPx; - } - - // The end button is also inset in the normal display. In the wide display it should be - // aligned with the ending edge of the list elements. - paddingEndOffset = mWideDisplayLateralOffsetPx + mWideDisplayEndOffsetPx; - - contentInsetStart = 0; - contentInsetStartWithNavigation = 0; - contentInsetEnd = 0; - contentInsetEndWithActions = 0; + if (newDisplayStyle.horizontal == HorizontalDisplayStyle.WIDE + && !(mIsSearching || mIsSelectionEnabled + || mNavigationButton != NAVIGATION_BUTTON_NONE)) { + // The title in the wide display should be aligned with the texts of the list elements. + paddingStartOffset = mWideDisplayStartOffsetPx; } - ApiCompatibilityUtils.setPaddingRelative(this, - padding + paddingStartOffset, this.getPaddingTop(), - padding + paddingEndOffset, this.getPaddingBottom()); - setContentInsetsRelative(contentInsetStart, contentInsetEnd); - setContentInsetStartWithNavigation(contentInsetStartWithNavigation); - setContentInsetEndWithActions(contentInsetEndWithActions); + ApiCompatibilityUtils.setPaddingRelative(this, padding + paddingStartOffset, + this.getPaddingTop(), padding, this.getPaddingBottom()); } /**
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index c73f619..1d22971 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -2435,6 +2435,12 @@ <message name="IDS_BOOKMARKS_FOLDER_EMPTY" desc="Text explaining that the currently selected bookmarks folder is empty."> No bookmarks here </message> + <message name="IDS_NO_BOOKMARKS" desc="Text describing that there is no bookmarks in a bookmark folder."> + No bookmarks + </message> + <message name="IDS_BOOKMARKS_COUNT" desc="Text describing the number of bookmarks in a bookmark folder [ICU Syntax]"> + {BOOKMARKS_COUNT, plural, =1 {%1$d bookmark} other {%1$d bookmarks}} + </message> <message name="IDS_BOOKMARK_PAGE_SAVED" desc="App-based message shown after user adds a new bookmark. [CHAR-LIMIT=32]"> Bookmarked in <ph name="PRODUCT_NAME">%1$s<ex>Chrome</ex></ph> </message>
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 1fdec26..f2b2ed2 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -1038,6 +1038,8 @@ "java/src/org/chromium/chrome/browser/suggestions/ImageFetcher.java", "java/src/org/chromium/chrome/browser/suggestions/MostVisitedSites.java", "java/src/org/chromium/chrome/browser/suggestions/MostVisitedSitesBridge.java", + "java/src/org/chromium/chrome/browser/suggestions/SiteSection.java", + "java/src/org/chromium/chrome/browser/suggestions/SiteSectionView.java", "java/src/org/chromium/chrome/browser/suggestions/SiteSuggestion.java", "java/src/org/chromium/chrome/browser/suggestions/SuggestionsCarousel.java", "java/src/org/chromium/chrome/browser/suggestions/SuggestionsCarouselAdapter.java", @@ -1046,8 +1048,8 @@ "java/src/org/chromium/chrome/browser/suggestions/SuggestionsConfig.java", "java/src/org/chromium/chrome/browser/suggestions/ThumbnailGradient.java", "java/src/org/chromium/chrome/browser/suggestions/Tile.java", - "java/src/org/chromium/chrome/browser/suggestions/TileGrid.java", "java/src/org/chromium/chrome/browser/suggestions/TileGridLayout.java", + "java/src/org/chromium/chrome/browser/suggestions/TileGridViewHolder.java", "java/src/org/chromium/chrome/browser/suggestions/OfflinableSuggestion.java", "java/src/org/chromium/chrome/browser/suggestions/SuggestionsOfflineModelObserver.java", "java/src/org/chromium/chrome/browser/suggestions/TileGroup.java",
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupUnitTest.java index 329017d..bb474a5a 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupUnitTest.java
@@ -25,7 +25,6 @@ import android.graphics.Bitmap; import android.graphics.Color; -import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; @@ -36,14 +35,10 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; -import org.chromium.base.ContextUtils; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; import org.chromium.chrome.browser.ntp.ContextMenuManager; @@ -81,26 +76,22 @@ private FakeMostVisitedSites mMostVisitedSites; private FakeImageFetcher mImageFetcher; + private TileRenderer mTileRenderer; @Before public void setUp() { - CardsVariationParameters.setTestVariationParams(new HashMap<String, String>()); - - // TODO(galinap): Should not be needed once we stop statically trying to guess column count. - ContextUtils.initApplicationContextForTests(RuntimeEnvironment.application); - + CardsVariationParameters.setTestVariationParams(new HashMap<>()); MockitoAnnotations.initMocks(this); mImageFetcher = new FakeImageFetcher(); + mTileRenderer = new TileRenderer( + RuntimeEnvironment.application, Style.CLASSIC, TILE_TITLE_LINES, mImageFetcher); mMostVisitedSites = new FakeMostVisitedSites(); - doAnswer(new Answer<Void>() { - @Override - public Void answer(InvocationOnMock invocation) throws Throwable { - mMostVisitedSites.setObserver(invocation.<MostVisitedSites.Observer>getArgument(0), - invocation.<Integer>getArgument(1)); - return null; - } + doAnswer(invocation -> { + mMostVisitedSites.setObserver( + invocation.getArgument(0), invocation.<Integer>getArgument(1)); + return null; }) .when(mTileGroupDelegate) .setMostVisitedSitesObserver(any(MostVisitedSites.Observer.class), anyInt()); @@ -115,16 +106,15 @@ public void testInitialiseWithTileList() { mMostVisitedSites.setTileSuggestions(URLS); - TileGroup tileGroup = - new TileGroup(RuntimeEnvironment.application, mock(SuggestionsUiDelegate.class), - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES, Style.CLASSIC); + TileGroup tileGroup = new TileGroup(mTileRenderer, mock(SuggestionsUiDelegate.class), + mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, + mock(OfflinePageBridge.class)); tileGroup.startObserving(MAX_TILES_TO_FETCH); verify(mTileGroupObserver).onTileCountChanged(); verify(mTileGroupObserver).onTileDataChanged(); - verify(mTileGroupDelegate, never()).onLoadingComplete(Mockito.<List<Tile>>any()); + verify(mTileGroupDelegate, never()).onLoadingComplete(any()); assertTrue(tileGroup.isTaskPending(TileGroup.TileTask.SCHEDULE_ICON_FETCH)); assertFalse(tileGroup.isTaskPending(TileGroup.TileTask.FETCH_DATA)); } @@ -135,16 +125,15 @@ */ @Test public void testInitialiseWithEmptyTileList() { - TileGroup tileGroup = - new TileGroup(RuntimeEnvironment.application, mock(SuggestionsUiDelegate.class), - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES, Style.CLASSIC); + TileGroup tileGroup = new TileGroup(mTileRenderer, mock(SuggestionsUiDelegate.class), + mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, + mock(OfflinePageBridge.class)); tileGroup.startObserving(MAX_TILES_TO_FETCH); verify(mTileGroupObserver).onTileCountChanged(); verify(mTileGroupObserver).onTileDataChanged(); - verify(mTileGroupDelegate, never()).onLoadingComplete(Mockito.<List<Tile>>any()); + verify(mTileGroupDelegate, never()).onLoadingComplete(any()); assertTrue(tileGroup.isTaskPending(TileGroup.TileTask.SCHEDULE_ICON_FETCH)); assertFalse(tileGroup.isTaskPending(TileGroup.TileTask.FETCH_DATA)); } @@ -186,7 +175,7 @@ verify(mTileGroupObserver).onTileDataChanged(); // Data DID change. // No load task the second time. - verify(mTileGroupDelegate, never()).onLoadingComplete(Mockito.<List<Tile>>any()); + verify(mTileGroupDelegate, never()).onLoadingComplete(any()); assertFalse(tileGroup.isTaskPending(TileGroup.TileTask.SCHEDULE_ICON_FETCH)); } @@ -203,7 +192,7 @@ verify(mTileGroupObserver, never()).onTileCountChanged(); // Tile count is still 2. // We should now have a pending task. - verify(mTileGroupDelegate, never()).onLoadingComplete(Mockito.<List<Tile>>any()); + verify(mTileGroupDelegate, never()).onLoadingComplete(any()); assertTrue(tileGroup.isTaskPending(TileGroup.TileTask.SCHEDULE_ICON_FETCH)); } @@ -216,7 +205,7 @@ verify(mTileGroupObserver).onTileCountChanged(); // Tile count DID change. verify(mTileGroupObserver).onTileDataChanged(); // Data DID change. verify(mTileGroupDelegate, never()) - .onLoadingComplete(Mockito.<List<Tile>>any()); // No load task the second time. + .onLoadingComplete(any()); // No load task the second time. assertFalse(tileGroup.isTaskPending(TileGroup.TileTask.SCHEDULE_ICON_FETCH)); } @@ -224,9 +213,9 @@ public void testTileLoadingWhenVisibleNotBlockedForInit() { SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); when(uiDelegate.isVisible()).thenReturn(true); - TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES, Style.CLASSIC); + TileGroup tileGroup = + new TileGroup(mTileRenderer, uiDelegate, mock(ContextMenuManager.class), + mTileGroupDelegate, mTileGroupObserver, mock(OfflinePageBridge.class)); tileGroup.startObserving(MAX_TILES_TO_FETCH); mMostVisitedSites.setTileSuggestions(URLS); @@ -239,9 +228,9 @@ public void testTileLoadingWhenVisibleBlocked() { SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); when(uiDelegate.isVisible()).thenReturn(true); - TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES, Style.CLASSIC); + TileGroup tileGroup = + new TileGroup(mTileRenderer, uiDelegate, mock(ContextMenuManager.class), + mTileGroupDelegate, mTileGroupObserver, mock(OfflinePageBridge.class)); tileGroup.startObserving(MAX_TILES_TO_FETCH); mMostVisitedSites.setTileSuggestions(URLS); @@ -278,18 +267,20 @@ @Test public void testRenderTileView() { SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); - when(uiDelegate.getImageFetcher()).thenReturn(mock(ImageFetcher.class)); - TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES, Style.CLASSIC); + when(uiDelegate.getImageFetcher()).thenReturn(mImageFetcher); + TileGroup tileGroup = + new TileGroup(mTileRenderer, uiDelegate, mock(ContextMenuManager.class), + mTileGroupDelegate, mTileGroupObserver, mock(OfflinePageBridge.class)); tileGroup.startObserving(MAX_TILES_TO_FETCH); - ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); + + TileGridViewHolder tileGrid = setupView(tileGroup); + TileGridLayout layout = (TileGridLayout) tileGrid.itemView; // Initialise the internal list of tiles mMostVisitedSites.setTileSuggestions(URLS); // Render them to the layout. - tileGroup.renderTiles(layout); + tileGrid.refreshData(); assertThat(layout.getChildCount(), is(2)); assertThat(((TileView) layout.getChildAt(0)).getUrl(), is(URLS[0])); assertThat(((TileView) layout.getChildAt(1)).getUrl(), is(URLS[1])); @@ -300,31 +291,32 @@ public void testRenderTileViewWithDuplicatedUrl() { SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); when(uiDelegate.getImageFetcher()).thenReturn(mock(ImageFetcher.class)); - TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES, Style.CLASSIC); + TileGroup tileGroup = + new TileGroup(mTileRenderer, uiDelegate, mock(ContextMenuManager.class), + mTileGroupDelegate, mTileGroupObserver, mock(OfflinePageBridge.class)); tileGroup.startObserving(MAX_TILES_TO_FETCH); - ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); + TileGridViewHolder tileGrid = setupView(tileGroup); // Initialise the internal list of tiles mMostVisitedSites.setTileSuggestions(URLS[0], URLS[1], URLS[0]); // Render them to the layout. The duplicated URL should trigger the exception. - tileGroup.renderTiles(layout); + tileGrid.refreshData(); } @Test public void testRenderTileViewReplacing() { SuggestionsUiDelegate uiDelegate = mock(SuggestionsUiDelegate.class); when(uiDelegate.getImageFetcher()).thenReturn(mock(ImageFetcher.class)); - TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES, Style.CLASSIC); + TileGroup tileGroup = + new TileGroup(mTileRenderer, uiDelegate, mock(ContextMenuManager.class), + mTileGroupDelegate, mTileGroupObserver, mock(OfflinePageBridge.class)); tileGroup.startObserving(MAX_TILES_TO_FETCH); mMostVisitedSites.setTileSuggestions(URLS); // Initialise the layout with views whose URLs don't match the ones of the new tiles. - ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); + TileGridViewHolder tileGrid = setupView(tileGroup); + TileGridLayout layout = (TileGridLayout) tileGrid.itemView; TileView view1 = mock(TileView.class); layout.addView(view1); @@ -332,7 +324,7 @@ layout.addView(view2); // The tiles should be updated, the old ones removed. - tileGroup.renderTiles(layout); + tileGrid.refreshData(); assertThat(layout.getChildCount(), is(2)); assertThat(layout.indexOfChild(view1), is(-1)); assertThat(layout.indexOfChild(view2), is(-1)); @@ -342,15 +334,13 @@ public void testRenderTileViewRecycling() { mMostVisitedSites.setTileSuggestions(URLS); List<SiteSuggestion> sites = mMostVisitedSites.getCurrentSites(); - - TileGroup tileGroup = - new TileGroup(RuntimeEnvironment.application, mock(SuggestionsUiDelegate.class), - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES, Style.CLASSIC); + TileGroup tileGroup = new TileGroup(mTileRenderer, mock(SuggestionsUiDelegate.class), + mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, + mock(OfflinePageBridge.class)); tileGroup.startObserving(MAX_TILES_TO_FETCH); // Initialise the layout with views whose URLs match the ones of the new tiles. - ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); + TileGridLayout layout = new TileGridLayout(RuntimeEnvironment.application, null); TileView view1 = mock(TileView.class); when(view1.getData()).thenReturn(sites.get(0)); layout.addView(view1); @@ -360,24 +350,24 @@ layout.addView(view2); // The tiles should be updated, the old ones reused. - tileGroup.renderTiles(layout); + setupView(tileGroup).refreshData(); assertThat(layout.getChildCount(), is(2)); - assertThat(layout.getChildAt(0), CoreMatchers.<View>is(view1)); - assertThat(layout.getChildAt(1), CoreMatchers.<View>is(view2)); + assertThat(layout.getChildAt(0), CoreMatchers.is(view1)); + assertThat(layout.getChildAt(1), CoreMatchers.is(view2)); } @Test public void testIconLoadingForInit() { TileGroup tileGroup = initialiseTileGroup(URLS); - Tile tile = tileGroup.getAllTiles().get(0); + Tile tile = tileGroup.getTiles().get(TileSectionType.PERSONALIZED).get(0); // Loading complete should be delayed until the icons are done loading. - verify(mTileGroupDelegate, never()).onLoadingComplete(Mockito.<List<Tile>>any()); + verify(mTileGroupDelegate, never()).onLoadingComplete(any()); mImageFetcher.fulfillLargeIconRequests(); // The load should now be complete. - verify(mTileGroupDelegate).onLoadingComplete(Mockito.<List<Tile>>any()); + verify(mTileGroupDelegate).onLoadingComplete(any()); verify(mTileGroupObserver).onTileIconChanged(eq(tile)); verify(mTileGroupObserver, times(URLS.length)).onTileIconChanged(any(Tile.class)); } @@ -388,7 +378,7 @@ Tile tile = new Tile(createSiteSuggestion("title", URLS[0]), 0); ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); - buildTileView(tile, layout, tileGroup); + mTileRenderer.buildTileView(tile, layout, tileGroup.getTileSetupDelegate()); // Ensure we run the callback for the new tile. assertEquals(1, mImageFetcher.getPendingIconCallbackCount()); @@ -397,6 +387,13 @@ verify(mTileGroupObserver, never()).onTileIconChanged(tile); } + private TileGridViewHolder setupView(TileGroup tileGroup) { + TileGridLayout layout = new TileGridLayout(RuntimeEnvironment.application, null); + TileGridViewHolder tileGrid = new TileGridViewHolder(layout, 4, 2); + tileGrid.bindDataSource(tileGroup, mTileRenderer); + return tileGrid; + } + @Test public void testIconLoading_Sync() { TileGroup tileGroup = initialiseTileGroup(); @@ -405,14 +402,13 @@ // Notify for a second set. mMostVisitedSites.setTileSuggestions(URLS); - ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); - tileGroup.renderTiles(layout); + setupView(tileGroup).refreshData(); mImageFetcher.fulfillLargeIconRequests(); // Data changed but no loading complete event is sent verify(mTileGroupObserver).onTileDataChanged(); verify(mTileGroupObserver, times(URLS.length)).onTileIconChanged(any(Tile.class)); - verify(mTileGroupDelegate, never()).onLoadingComplete(Mockito.<List<Tile>>any()); + verify(mTileGroupDelegate, never()).onLoadingComplete(any()); } @Test @@ -424,14 +420,13 @@ // Notify for a second set. mMostVisitedSites.setTileSuggestions(URLS); tileGroup.onSwitchToForeground(/* trackLoadTask: */ false); - ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); - tileGroup.renderTiles(layout); + setupView(tileGroup).refreshData(); mImageFetcher.fulfillLargeIconRequests(); // Data changed but no loading complete event is sent (same as sync) verify(mTileGroupObserver).onTileDataChanged(); verify(mTileGroupObserver, times(URLS.length)).onTileIconChanged(any(Tile.class)); - verify(mTileGroupDelegate, never()).onLoadingComplete(Mockito.<List<Tile>>any()); + verify(mTileGroupDelegate, never()).onLoadingComplete(any()); } @Test @@ -443,14 +438,13 @@ // Notify for a second set. mMostVisitedSites.setTileSuggestions(URLS); tileGroup.onSwitchToForeground(/* trackLoadTask: */ true); - ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); - tileGroup.renderTiles(layout); + setupView(tileGroup).refreshData(); mImageFetcher.fulfillLargeIconRequests(); // Data changed but no loading complete event is sent verify(mTileGroupObserver).onTileDataChanged(); verify(mTileGroupObserver, times(URLS.length)).onTileIconChanged(any(Tile.class)); - verify(mTileGroupDelegate).onLoadingComplete(Mockito.<List<Tile>>any()); + verify(mTileGroupDelegate).onLoadingComplete(any()); } /** {@link #initialiseTileGroup(boolean, String...)} override that does not defer loads. */ @@ -471,23 +465,17 @@ mMostVisitedSites.setTileSuggestions(urls); - TileGroup tileGroup = new TileGroup(RuntimeEnvironment.application, uiDelegate, - mock(ContextMenuManager.class), mTileGroupDelegate, mTileGroupObserver, - mock(OfflinePageBridge.class), TILE_TITLE_LINES, TileView.Style.CLASSIC); + TileGroup tileGroup = + new TileGroup(mTileRenderer, uiDelegate, mock(ContextMenuManager.class), + mTileGroupDelegate, mTileGroupObserver, mock(OfflinePageBridge.class)); tileGroup.startObserving(MAX_TILES_TO_FETCH); - - ViewGroup layout = new FrameLayout(RuntimeEnvironment.application, null); - tileGroup.renderTiles(layout); + setupView(tileGroup).refreshData(); reset(mTileGroupObserver); reset(mTileGroupDelegate); return tileGroup; } - private void buildTileView(Tile tile, ViewGroup layout, TileGroup tileGroup) { - tileGroup.getTileRenderer().buildTileView(tile, layout, tileGroup.getTileSetupDelegate()); - } - private class FakeImageFetcher extends ImageFetcher { private final List<LargeIconCallback> mCallbackList = new ArrayList<>();
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index ed0a6ef..1b6543f 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -649,9 +649,6 @@ <if expr="use_nss_certs"> <!-- Certificate Manager Page --> - <message name="IDS_SETTINGS_CERTIFICATE_MANAGER" desc="Name of the certificate manager page which allows users to modify SSL certificate settings."> - Certificate manager - </message> <message name="IDS_SETTINGS_CERTIFICATE_MANAGER_YOUR_CERTIFICATES" desc="Label for the your certificates tab in certificate manager."> Your certificates </message>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 01458e6..d20b00f 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -1325,6 +1325,8 @@ "ssl/insecure_sensitive_input_driver.h", "ssl/insecure_sensitive_input_driver_factory.cc", "ssl/insecure_sensitive_input_driver_factory.h", + "ssl/mitm_software_blocking_page.cc", + "ssl/mitm_software_blocking_page.h", "ssl/security_state_tab_helper.cc", "ssl/security_state_tab_helper.h", "ssl/ssl_blocking_page.cc", @@ -1470,6 +1472,13 @@ "win/titlebar_config.h", ] + if (is_ios) { + sources -= [ + "ssl/mitm_software_blocking_page.cc", + "ssl/mitm_software_blocking_page.h", + ] + } + configs += [ "//build/config/compiler:wexit_time_destructors", "//build/config:precompiled_headers", @@ -4391,6 +4400,8 @@ "net/dns_probe_test_util.h", "net/url_request_mock_util.cc", "net/url_request_mock_util.h", + "notifications/notification_display_service_tester.cc", + "notifications/notification_display_service_tester.h", "notifications/notification_test_util.cc", "notifications/notification_test_util.h", "notifications/stub_notification_display_service.cc",
diff --git a/chrome/browser/autofill/form_structure_browsertest.cc b/chrome/browser/autofill/form_structure_browsertest.cc index 3ee85ae5..f1827379 100644 --- a/chrome/browser/autofill/form_structure_browsertest.cc +++ b/chrome/browser/autofill/form_structure_browsertest.cc
@@ -6,12 +6,14 @@ #include <vector> #include "base/command_line.h" +#include "base/feature_list.h" #include "base/files/file_enumerator.h" #include "base/files/file_path.h" #include "base/macros.h" #include "base/path_service.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -20,6 +22,7 @@ #include "chrome/test/base/ui_test_utils.h" #include "components/autofill/content/browser/content_autofill_driver.h" #include "components/autofill/content/browser/content_autofill_driver_factory.h" +#include "components/autofill/core/browser/autofill_experiments.h" #include "components/autofill/core/browser/autofill_manager.h" #include "components/autofill/core/browser/data_driven_test.h" #include "components/autofill/core/browser/form_structure.h" @@ -98,11 +101,14 @@ const std::vector<std::unique_ptr<FormStructure>>& forms); private: + base::test::ScopedFeatureList feature_list_; DISALLOW_COPY_AND_ASSIGN(FormStructureBrowserTest); }; FormStructureBrowserTest::FormStructureBrowserTest() : DataDrivenTest(GetTestDataDir()) { + feature_list_.InitAndEnableFeature( + autofill::kAutofillRationalizeFieldTypePredictions); } FormStructureBrowserTest::~FormStructureBrowserTest() {
diff --git a/chrome/browser/chromeos/app_mode/certificate_manager_dialog.cc b/chrome/browser/chromeos/app_mode/certificate_manager_dialog.cc index 7546ae3..90aaf14d 100644 --- a/chrome/browser/chromeos/app_mode/certificate_manager_dialog.cc +++ b/chrome/browser/chromeos/app_mode/certificate_manager_dialog.cc
@@ -18,17 +18,9 @@ namespace { -// Hints for size of certificate manager dialog. -const int kCertificateManagerDialogReasonableWidth = 712; -const int kCertificateManagerDialogReasonableHeight = 412; -const float kCertificateManagerDialogReasonableWidthRatio = 0.4f; -const float kCertificateManagerDialogReasonableHeightRatio = 0.4f; - -int CalculateSize(int screen_size, int min_comfortable, float desired_ratio) { - int desired_size = static_cast<int>(desired_ratio * screen_size); - desired_size = std::max(min_comfortable, desired_size); - return std::min(screen_size, desired_size); -} +// The width matches the Settings UI width. +const int kDefaultWidth = 640; +const int kDefaultHeight = 480; } // namespace @@ -42,22 +34,16 @@ delegate, window, base::string16(), - GURL(chrome::kChromeUICertificateManagerDialogURL)) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + GURL(chrome::kChromeUICertificateManagerDialogURL)) {} - gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); - SetDialogSize(CalculateSize(screen_bounds.width(), - kCertificateManagerDialogReasonableWidth, - kCertificateManagerDialogReasonableWidthRatio), - CalculateSize(screen_bounds.height(), - kCertificateManagerDialogReasonableHeight, - kCertificateManagerDialogReasonableHeightRatio)); +CertificateManagerDialog::~CertificateManagerDialog() {} - SetDialogTitle(l10n_util::GetStringUTF16(IDS_CERTIFICATE_MANAGER_TITLE)); +base::string16 CertificateManagerDialog::GetDialogTitle() const { + return l10n_util::GetStringUTF16(IDS_CERTIFICATE_MANAGER_TITLE); } -CertificateManagerDialog::~CertificateManagerDialog() { +void CertificateManagerDialog::GetDialogSize(gfx::Size* size) const { + size->SetSize(kDefaultWidth, kDefaultHeight); } - } // namespace chromeos
diff --git a/chrome/browser/chromeos/app_mode/certificate_manager_dialog.h b/chrome/browser/chromeos/app_mode/certificate_manager_dialog.h index 5924568..5f659b58 100644 --- a/chrome/browser/chromeos/app_mode/certificate_manager_dialog.h +++ b/chrome/browser/chromeos/app_mode/certificate_manager_dialog.h
@@ -21,6 +21,10 @@ gfx::NativeWindow window); ~CertificateManagerDialog() override; + // ui::WebDialogDelegate + base::string16 GetDialogTitle() const override; + void GetDialogSize(gfx::Size* size) const override; + private: DISALLOW_COPY_AND_ASSIGN(CertificateManagerDialog); };
diff --git a/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc b/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc index 0e37a33..fbae3129 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc
@@ -11,6 +11,7 @@ #include "base/single_thread_task_runner.h" #include "base/strings/string_util.h" #include "base/sys_info.h" +#include "base/syslog_logging.h" #include "base/threading/thread_task_runner_handle.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" #include "chrome/browser/chromeos/login/auth/chrome_login_performer.h" @@ -80,7 +81,7 @@ const int kMaxRetryTimes = 5; ++retry_count_; if (retry_count_ > kMaxRetryTimes) { - LOG(ERROR) << "Could not talk to cryptohomed for launching kiosk app."; + SYSLOG(ERROR) << "Could not talk to cryptohomed for launching kiosk app."; ReportCheckResult(KioskAppLaunchError::CRYPTOHOMED_NOT_RUNNING); return; } @@ -109,7 +110,7 @@ } if (is_mounted) - LOG(ERROR) << "Cryptohome is mounted before launching kiosk app."; + SYSLOG(ERROR) << "Cryptohome is mounted before launching kiosk app."; // Proceed only when cryptohome is not mounded or running on dev box. if (!is_mounted || !base::SysInfo::IsRunningOnChromeOS()) @@ -185,7 +186,7 @@ } void KioskProfileLoader::OnAuthFailure(const AuthFailure& error) { - LOG(ERROR) << "Kiosk auth failure: error=" << error.GetErrorString(); + SYSLOG(ERROR) << "Kiosk auth failure: error=" << error.GetErrorString(); KioskAppLaunchError::SaveCryptohomeFailure(error); ReportLaunchResult(LoginFailureToKioskAppLaunchError(error)); }
diff --git a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc index 418b109..120801ab 100644 --- a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc +++ b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
@@ -9,6 +9,7 @@ #include "base/files/file_path.h" #include "base/json/json_file_value_serializer.h" #include "base/path_service.h" +#include "base/syslog_logging.h" #include "base/task_scheduler/post_task.h" #include "base/time/time.h" #include "base/values.h" @@ -97,6 +98,8 @@ } void StartupAppLauncher::ContinueWithNetworkReady() { + SYSLOG(INFO) << "ContinueWithNetworkReady" + << ", network_ready_handled_=" << network_ready_handled_; if (network_ready_handled_) return; @@ -139,7 +142,6 @@ base::DictionaryValue* dict = NULL; if (error_code != JSONFileValueDeserializer::JSON_NO_ERROR || !value.get() || !value->GetAsDictionary(&dict)) { - LOG(WARNING) << "Can't find auth file at " << auth_file.value(); return; } @@ -171,7 +173,7 @@ ->extension_service() ->pending_extension_manager() ->IsIdPending(app_id_)) { - LOG(WARNING) << "Installer still running"; + SYSLOG(WARNING) << "Installer still running"; return; } @@ -188,6 +190,10 @@ (extension && !extensions::OfflineEnabledInfo::IsOfflineEnabled(extension)); + SYSLOG(INFO) << "MaybeInitializeNetwork" + << ", requires_network=" << requires_network + << ", network_ready=" << delegate_->IsNetworkReady(); + if (requires_network) { delegate_->InitializeNetwork(); return; @@ -253,6 +259,7 @@ } void StartupAppLauncher::MaybeLaunchApp() { + SYSLOG(INFO) << "MaybeLaunchApp"; const Extension* extension = GetPrimaryAppExtension(); // Verify that requred apps are installed. While the apps should be // present at this point, crash recovery flow skips app installation steps - @@ -285,6 +292,7 @@ } void StartupAppLauncher::MaybeCheckExtensionUpdate() { + SYSLOG(INFO) << "MaybeCheckExtensionUpdate"; extensions::ExtensionUpdater* updater = extensions::ExtensionSystem::Get(profile_) ->extension_service() @@ -311,6 +319,7 @@ } void StartupAppLauncher::OnExtensionUpdateCheckFinished() { + SYSLOG(INFO) << "OnExtensionUpdateCheckFinished"; if (extension_update_found_) { // Reload the primary app to make sure any reference to the previous version // of the shared module, extension, etc will be cleaned up andthe new @@ -334,13 +343,15 @@ const std::string& id = content::Details<UpdateDetails>(details)->first; const base::Version& version = content::Details<UpdateDetails>(details)->second; - VLOG(1) << "Found extension update id=" << id - << " version=" << version.GetString(); + SYSLOG(INFO) << "Found extension update id=" << id + << " version=" << version.GetString(); extension_update_found_ = true; } void StartupAppLauncher::OnFinishCrxInstall(const std::string& extension_id, bool success) { + SYSLOG(INFO) << "OnFinishCrxInstall, id=" << extension_id + << ", success=" << success; // Wait for pending updates or dependent extensions to download. if (extensions::ExtensionSystem::Get(profile_) ->extension_service() @@ -353,7 +364,7 @@ extensions::InstallTrackerFactory::GetForBrowserContext(profile_); tracker->RemoveObserver(this); if (delegate_->IsShowingNetworkConfigScreen()) { - LOG(WARNING) << "Showing network config screen"; + SYSLOG(WARNING) << "Showing network config screen"; return; } @@ -446,7 +457,7 @@ return false; if (id == app_id_) { - LOG(ERROR) << "Failed to install crx file of the primary app id=" << id; + SYSLOG(ERROR) << "Failed to install crx file of the primary app id=" << id; return true; } @@ -457,12 +468,12 @@ extensions::KioskModeInfo* info = extensions::KioskModeInfo::Get(extension); for (const auto& app_id : info->secondary_app_ids) { if (app_id == id) { - LOG(ERROR) << "Failed to install a secondary app id=" << id; + SYSLOG(ERROR) << "Failed to install a secondary app id=" << id; return true; } } - LOG(WARNING) << "Failed to install crx file for an app id=" << id; + SYSLOG(WARNING) << "Failed to install crx file for an app id=" << id; return false; } @@ -476,7 +487,7 @@ void StartupAppLauncher::LaunchApp() { if (!ready_to_launch_) { NOTREACHED(); - LOG(ERROR) << "LaunchApp() called but launcher is not initialized."; + SYSLOG(ERROR) << "LaunchApp() called but launcher is not initialized."; } const Extension* extension = GetPrimaryAppExtension(); @@ -487,6 +498,8 @@ return; } + SYSLOG(INFO) << "Attempt to launch app."; + // Always open the app in a window. OpenApplication(AppLaunchParams( profile_, extension, extensions::LAUNCH_CONTAINER_WINDOW, @@ -511,13 +524,14 @@ } void StartupAppLauncher::OnLaunchFailure(KioskAppLaunchError::Error error) { - LOG(ERROR) << "App launch failed, error: " << error; + SYSLOG(ERROR) << "App launch failed, error: " << error; DCHECK_NE(KioskAppLaunchError::NONE, error); delegate_->OnLaunchFailed(error); } void StartupAppLauncher::BeginInstall() { + SYSLOG(INFO) << "BeginInstall"; extensions::file_util::SetUseSafeInstallation(true); KioskAppManager::Get()->InstallFromCache(app_id_); if (extensions::ExtensionSystem::Get(profile_) @@ -580,6 +594,7 @@ } void StartupAppLauncher::OnReadyToLaunch() { + SYSLOG(INFO) << "Kiosk app is ready to launch."; ready_to_launch_ = true; MaybeUpdateAppData(); delegate_->OnReadyToLaunch();
diff --git a/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.cc b/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.cc index 8c974e9..bf6bf0c 100644 --- a/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.cc +++ b/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.cc
@@ -175,7 +175,7 @@ } MAP_ROLE(ui::kAXListViewClassname, ui::AX_ROLE_LIST); MAP_ROLE(ui::kAXMenuItemClassname, ui::AX_ROLE_MENU_ITEM); - MAP_ROLE(ui::kAXPagerClassname, ui::AX_ROLE_SCROLL_AREA); + MAP_ROLE(ui::kAXPagerClassname, ui::AX_ROLE_GROUP); MAP_ROLE(ui::kAXProgressBarClassname, ui::AX_ROLE_PROGRESS_INDICATOR); MAP_ROLE(ui::kAXRadioButtonClassname, ui::AX_ROLE_RADIO_BUTTON); MAP_ROLE(ui::kAXSeekBarClassname, ui::AX_ROLE_SLIDER);
diff --git a/chrome/browser/chromeos/login/app_launch_controller.cc b/chrome/browser/chromeos/login/app_launch_controller.cc index 520f2a3..0321bd7 100644 --- a/chrome/browser/chromeos/login/app_launch_controller.cc +++ b/chrome/browser/chromeos/login/app_launch_controller.cc
@@ -15,6 +15,7 @@ #include "base/memory/weak_ptr.h" #include "base/metrics/histogram_macros.h" #include "base/single_thread_task_runner.h" +#include "base/syslog_logging.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "base/values.h" @@ -163,7 +164,7 @@ } void AppLaunchController::StartAppLaunch(bool is_auto_launch) { - DVLOG(1) << "Starting kiosk mode..."; + SYSLOG(INFO) << "Starting kiosk mode..."; RecordKioskLaunchUMA(is_auto_launch); @@ -307,7 +308,7 @@ } void AppLaunchController::OnProfileLoaded(Profile* profile) { - DVLOG(1) << "Profile loaded... Starting app launch."; + SYSLOG(INFO) << "Profile loaded... Starting app launch."; profile_ = profile; // This is needed to trigger input method extensions being loaded. @@ -353,8 +354,8 @@ void AppLaunchController::OnNetworkWaitTimedout() { DCHECK(waiting_for_network_); - LOG(WARNING) << "OnNetworkWaitTimedout... connection = " - << net::NetworkChangeNotifier::GetConnectionType(); + SYSLOG(WARNING) << "OnNetworkWaitTimedout... connection = " + << net::NetworkChangeNotifier::GetConnectionType(); network_wait_timedout_ = true; MaybeShowNetworkConfigureUI(); @@ -364,7 +365,7 @@ } void AppLaunchController::OnAppWindowCreated() { - DVLOG(1) << "App window created, closing splash screen."; + SYSLOG(INFO) << "App window created, closing splash screen."; CleanUp(); } @@ -508,7 +509,7 @@ } void AppLaunchController::OnLaunchSucceeded() { - DVLOG(1) << "Kiosk launch succeeded, wait for app window."; + SYSLOG(INFO) << "Kiosk launch succeeded, wait for app window."; app_launch_splash_screen_view_->UpdateAppLaunchState( AppLaunchSplashScreenView::APP_LAUNCH_STATE_WAITING_APP_WINDOW); @@ -518,7 +519,7 @@ void AppLaunchController::OnLaunchFailed(KioskAppLaunchError::Error error) { DCHECK_NE(KioskAppLaunchError::NONE, error); - LOG(ERROR) << "Kiosk launch failed, error=" << error; + SYSLOG(ERROR) << "Kiosk launch failed, error=" << error; // Reboot on the recoverable cryptohome errors. if (error == KioskAppLaunchError::CRYPTOHOMED_NOT_RUNNING ||
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc index 3bda5f78..1eaec03 100644 --- a/chrome/browser/devtools/devtools_window.cc +++ b/chrome/browser/devtools/devtools_window.cc
@@ -991,8 +991,11 @@ DCHECK(source == main_web_contents_); if (!params.url.SchemeIs(content::kChromeDevToolsScheme)) { WebContents* inspected_web_contents = GetInspectedWebContents(); - return inspected_web_contents ? - inspected_web_contents->OpenURL(params) : NULL; + if (!inspected_web_contents) + return nullptr; + content::OpenURLParams modified = params; + modified.referrer = content::Referrer(); + return inspected_web_contents->OpenURL(modified); } bindings_->Reload(); return main_web_contents_;
diff --git a/chrome/browser/extensions/api/notifications/notifications_apitest.cc b/chrome/browser/extensions/api/notifications/notifications_apitest.cc index a1ab2f0..90717ea 100644 --- a/chrome/browser/extensions/api/notifications/notifications_apitest.cc +++ b/chrome/browser/extensions/api/notifications/notifications_apitest.cc
@@ -18,10 +18,9 @@ #include "chrome/browser/extensions/extension_function_test_utils.h" #include "chrome/browser/notifications/notification.h" #include "chrome/browser/notifications/notification_common.h" -#include "chrome/browser/notifications/notification_display_service_factory.h" +#include "chrome/browser/notifications/notification_display_service_tester.h" #include "chrome/browser/notifications/notifier_state_tracker.h" #include "chrome/browser/notifications/notifier_state_tracker_factory.h" -#include "chrome/browser/notifications/stub_notification_display_service.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/extensions/app_launch_params.h" #include "chrome/browser/ui/extensions/application_launch.h" @@ -166,11 +165,6 @@ return ExtensionNotificationDisplayHelperFactory::GetForProfile(profile()); } - StubNotificationDisplayService* GetDisplayService() { - return reinterpret_cast<StubNotificationDisplayService*>( - NotificationDisplayServiceFactory::GetForProfile(profile())); - } - NotifierStateTracker* GetNotifierStateTracker() { return NotifierStateTrackerFactory::GetForProfile(profile()); } @@ -180,8 +174,13 @@ ExtensionApiTest::SetUpOnMainThread(); DCHECK(profile()); - NotificationDisplayServiceFactory::GetInstance()->SetTestingFactory( - profile(), &StubNotificationDisplayService::FactoryForTests); + display_service_tester_ = + base::MakeUnique<NotificationDisplayServiceTester>(profile()); + } + + void TearDown() override { + display_service_tester_.reset(); + ExtensionApiTest::TearDown(); } // Returns the notification that's being displayed for |extension|, or nullptr @@ -220,6 +219,8 @@ extensions::kAllowFullscreenAppNotificationsFeature); } + std::unique_ptr<NotificationDisplayServiceTester> display_service_tester_; + private: base::test::ScopedFeatureList feature_list_; }; @@ -255,7 +256,7 @@ ResultCatcher catcher; const std::string notification_id = GetNotificationIdFromDelegateId(extension->id() + "-FOO"); - GetDisplayService()->RemoveNotification( + display_service_tester_->RemoveNotification( NotificationCommon::EXTENSION, notification_id, false /* by_user */); EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); } @@ -264,21 +265,21 @@ ResultCatcher catcher; const std::string notification_id = GetNotificationIdFromDelegateId(extension->id() + "-BAR"); - GetDisplayService()->RemoveNotification( + display_service_tester_->RemoveNotification( NotificationCommon::EXTENSION, notification_id, true /* by_user */); EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); } { ResultCatcher catcher; - GetDisplayService()->RemoveAllNotifications(NotificationCommon::EXTENSION, - false /* by_user */); + display_service_tester_->RemoveAllNotifications( + NotificationCommon::EXTENSION, false /* by_user */); EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); } { ResultCatcher catcher; - GetDisplayService()->RemoveAllNotifications(NotificationCommon::EXTENSION, - true /* by_user */); + display_service_tester_->RemoveAllNotifications( + NotificationCommon::EXTENSION, true /* by_user */); EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); } }
diff --git a/chrome/browser/extensions/extension_message_bubble_controller.cc b/chrome/browser/extensions/extension_message_bubble_controller.cc index 28406d85..7d90eb4 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller.cc +++ b/chrome/browser/extensions/extension_message_bubble_controller.cc
@@ -105,7 +105,9 @@ initialized_(false), is_highlighting_(false), is_active_bubble_(false), + extension_registry_observer_(this), browser_list_observer_(this) { + extension_registry_observer_.Add(ExtensionRegistry::Get(browser_->profile())); browser_list_observer_.Add(BrowserList::GetInstance()); } @@ -201,12 +203,21 @@ } } -void ExtensionMessageBubbleController::OnShown() { +void ExtensionMessageBubbleController::OnShown( + const base::Closure& close_bubble_callback) { + close_bubble_callback_ = close_bubble_callback; DCHECK(is_active_bubble_); GetProfileSet()->insert(profile()->GetOriginalProfile()); } void ExtensionMessageBubbleController::OnBubbleAction() { + // In addition to closing the bubble, OnBubbleAction() may result in a removal + // or disabling of the extension. To prevent triggering OnExtensionUnloaded(), + // which will also try to close the bubble, the controller's extension + // registry observer is removed. Note, we do not remove the extension registry + // observer in the cases of OnBubbleDismiss() and OnLinkedClicked() since they + // do not result in extensions being unloaded. + extension_registry_observer_.RemoveAll(); DCHECK_EQ(ACTION_BOUNDARY, user_action_); user_action_ = ACTION_EXECUTE; @@ -269,6 +280,19 @@ g_should_ignore_learn_more_for_testing = should_ignore; } +void ExtensionMessageBubbleController::OnExtensionUnloaded( + content::BrowserContext* browser_context, + const Extension* extension, + UnloadedExtensionReason reason) { + UpdateExtensionIdList(); + // If the callback is set, then that means that OnShown() was called, and the + // bubble is displayed. + if (close_bubble_callback_ && GetExtensionIdList().empty()) { + base::ResetAndReturn(&close_bubble_callback_).Run(); + } + // If the bubble refers to multiple extensions, we do not close the bubble. +} + void ExtensionMessageBubbleController::OnBrowserRemoved(Browser* browser) { if (browser == browser_) { if (is_highlighting_) {
diff --git a/chrome/browser/extensions/extension_message_bubble_controller.h b/chrome/browser/extensions/extension_message_bubble_controller.h index 53a13a7..33e306a2 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller.h +++ b/chrome/browser/extensions/extension_message_bubble_controller.h
@@ -13,6 +13,7 @@ #include "base/scoped_observer.h" #include "chrome/browser/ui/browser_list_observer.h" #include "extensions/browser/browser_context_keyed_api_factory.h" +#include "extensions/browser/extension_registry_observer.h" #include "extensions/common/extension.h" class Browser; @@ -25,7 +26,8 @@ class ExtensionRegistry; -class ExtensionMessageBubbleController : public chrome::BrowserListObserver { +class ExtensionMessageBubbleController : public chrome::BrowserListObserver, + public ExtensionRegistryObserver { public: // UMA histogram constants. enum BubbleAction { @@ -167,7 +169,8 @@ // Called when the bubble is actually shown. Because some bubbles are delayed // (in order to weather the "focus storm"), they are not shown immediately. - void OnShown(); + // Accepts a callback from platform-specifc ui code to close the bubble. + void OnShown(const base::Closure& close_bubble_callback); // Callbacks from bubble. Declared virtual for testing purposes. virtual void OnBubbleAction(); @@ -183,6 +186,10 @@ bool should_ignore_learn_more); private: + // ExtensionRegistryObserver: + void OnExtensionUnloaded(content::BrowserContext* browser_context, + const Extension* extension, + UnloadedExtensionReason reason) override; // BrowserListObserver: void OnBrowserRemoved(Browser* browser) override; @@ -221,6 +228,11 @@ // Whether or not this bubble is the active bubble being shown. bool is_active_bubble_; + // Platform-specific implementation of closing the bubble. + base::Closure close_bubble_callback_; + + ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> + extension_registry_observer_; ScopedObserver<BrowserList, BrowserListObserver> browser_list_observer_; DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleController);
diff --git a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc index c93f79c..9e6f49b 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc +++ b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc
@@ -121,10 +121,13 @@ BUBBLE_ACTION_CLICK_DISMISS_BUTTON, BUBBLE_ACTION_DISMISS_DEACTIVATION, BUBBLE_ACTION_CLICK_LINK, + BUBBLE_ACTION_IGNORE, }; FakeExtensionMessageBubble() - : action_(BUBBLE_ACTION_CLICK_ACTION_BUTTON), controller_(nullptr) {} + : is_closed_(true), + action_(BUBBLE_ACTION_CLICK_ACTION_BUTTON), + controller_(nullptr) {} void set_action_on_show(ExtensionBubbleAction action) { action_ = action; @@ -133,25 +136,43 @@ controller_ = controller; } + bool is_closed() { return is_closed_; } + void Show() { - controller_->OnShown(); + controller_->OnShown( + base::Bind(&FakeExtensionMessageBubble::Close, base::Unretained(this))); + + // Depending on the user action, the bubble may be closed as result. switch (action_) { case BUBBLE_ACTION_CLICK_ACTION_BUTTON: controller_->OnBubbleAction(); + is_closed_ = true; break; case BUBBLE_ACTION_CLICK_DISMISS_BUTTON: controller_->OnBubbleDismiss(false); + is_closed_ = true; break; case BUBBLE_ACTION_DISMISS_DEACTIVATION: controller_->OnBubbleDismiss(true); + is_closed_ = true; break; case BUBBLE_ACTION_CLICK_LINK: controller_->OnLinkClicked(); + // Opening a new tab for the learn more link can cause the bubble to + // close. + is_closed_ = true; + break; + case BUBBLE_ACTION_IGNORE: + is_closed_ = false; break; } } private: + // Dummy close callback. + void Close() { is_closed_ = true; } + + bool is_closed_; ExtensionBubbleAction action_; ExtensionMessageBubbleController* controller_; @@ -797,6 +818,86 @@ } } +// Tests that a displayed extension bubble will be closed after its associated +// extension is uninstalled. +TEST_F(ExtensionMessageBubbleTest, TestBubbleClosedAfterExtensionUninstall) { + Init(); + ASSERT_TRUE(LoadExtensionOverridingNtp("1", kId1, Manifest::UNPACKED)); + + auto controller = base::MakeUnique<TestExtensionMessageBubbleController>( + new NtpOverriddenBubbleDelegate(browser()->profile()), browser()); + controller->SetIsActiveBubble(); + + EXPECT_TRUE(controller->ShouldShow()); + ASSERT_EQ(1U, controller->GetExtensionList().size()); + + // Simulate showing the bubble and take no action. + FakeExtensionMessageBubble bubble; + EXPECT_TRUE(controller->ShouldShow()); + bubble.set_controller(controller.get()); + bubble.set_action_on_show(FakeExtensionMessageBubble::BUBBLE_ACTION_IGNORE); + bubble.Show(); + EXPECT_FALSE(bubble.is_closed()); + + // Uninstall the extension. + service_->UninstallExtension(kId1, UNINSTALL_REASON_FOR_TESTING, + base::Bind(&base::DoNothing), nullptr); + ASSERT_EQ(0U, controller->GetExtensionList().size()); + + // The bubble should be closed after the extension is uninstalled. + EXPECT_TRUE(bubble.is_closed()); + + controller.reset(); +} + +// Tests that a bubble associated with multiple extensions remains shown after +// one of its associated extensions is uninstalled. Also tests that the bubble +// closes when all of its associated extensions are uninstalled. +TEST_F(ExtensionMessageBubbleTest, TestBubbleShownForMultipleExtensions) { + FeatureSwitch::ScopedOverride force_dev_mode_highlighting( + FeatureSwitch::force_dev_mode_highlighting(), true); + Init(); + ASSERT_TRUE(LoadGenericExtension("1", kId1, Manifest::UNPACKED)); + ASSERT_TRUE(LoadGenericExtension("2", kId2, Manifest::UNPACKED)); + ASSERT_TRUE(LoadGenericExtension("3", kId3, Manifest::UNPACKED)); + + auto controller = base::MakeUnique<TestExtensionMessageBubbleController>( + new DevModeBubbleDelegate(browser()->profile()), browser()); + controller->SetIsActiveBubble(); + + EXPECT_TRUE(controller->ShouldShow()); + ASSERT_EQ(3U, controller->GetExtensionList().size()); + + // Simulate showing the bubble and take no action. + FakeExtensionMessageBubble bubble; + EXPECT_TRUE(controller->ShouldShow()); + bubble.set_controller(controller.get()); + bubble.set_action_on_show(FakeExtensionMessageBubble::BUBBLE_ACTION_IGNORE); + bubble.Show(); + EXPECT_FALSE(bubble.is_closed()); + + // Uninstall one of the three extensions. + service_->UninstallExtension(kId1, UNINSTALL_REASON_FOR_TESTING, + base::Bind(&base::DoNothing), nullptr); + ASSERT_EQ(2U, controller->GetExtensionList().size()); + + // The bubble should still be shown for the remaining installed extensions. + EXPECT_FALSE(bubble.is_closed()); + + // Uninstall the remaining two extensions. + service_->UninstallExtension(kId2, UNINSTALL_REASON_FOR_TESTING, + base::Bind(&base::DoNothing), nullptr); + service_->UninstallExtension(kId3, UNINSTALL_REASON_FOR_TESTING, + base::Bind(&base::DoNothing), nullptr); + ASSERT_EQ(0U, controller->GetExtensionList().size()); + + // Since all the bubble's associated extensions are uninstalled, the bubble + // should be closed. + EXPECT_TRUE(bubble.is_closed()); + + controller.reset(); +} + // The feature this is meant to test is only enacted on Windows, but it should // pass on all platforms. TEST_F(ExtensionMessageBubbleTest, NtpOverriddenControllerTest) {
diff --git a/chrome/browser/extensions/native_bindings_apitest.cc b/chrome/browser/extensions/native_bindings_apitest.cc index c6f33e1..83f50535 100644 --- a/chrome/browser/extensions/native_bindings_apitest.cc +++ b/chrome/browser/extensions/native_bindings_apitest.cc
@@ -17,6 +17,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/test/base/ui_test_utils.h" +#include "content/public/test/browser_test_utils.h" #include "extensions/browser/api/file_system/file_system_api.h" #include "extensions/browser/event_router.h" #include "extensions/browser/process_manager.h" @@ -253,4 +254,28 @@ EXPECT_TRUE(listener.WaitUntilSatisfied()); } +// Tests that bindings are available in WebUI pages. +IN_PROC_BROWSER_TEST_F(NativeBindingsApiTest, WebUIBindings) { + ui_test_utils::NavigateToURL(browser(), GURL("chrome://extensions")); + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + auto api_exists = [web_contents](const std::string& api_name) { + bool exists = false; + EXPECT_TRUE(content::ExecuteScriptAndExtractBool( + web_contents, + base::StringPrintf("window.domAutomationController.send(!!%s);", + api_name.c_str()), + &exists)); + return exists; + }; + + EXPECT_TRUE(api_exists("chrome.developerPrivate")); + EXPECT_TRUE(api_exists("chrome.developerPrivate.getProfileConfiguration")); + EXPECT_TRUE(api_exists("chrome.management")); + EXPECT_TRUE(api_exists("chrome.management.setEnabled")); + EXPECT_FALSE(api_exists("chrome.networkingPrivate")); + EXPECT_FALSE(api_exists("chrome.sockets")); + EXPECT_FALSE(api_exists("chrome.browserAction")); +} + } // namespace extensions
diff --git a/chrome/browser/notifications/notification_display_service_tester.cc b/chrome/browser/notifications/notification_display_service_tester.cc new file mode 100644 index 0000000..6228e48 --- /dev/null +++ b/chrome/browser/notifications/notification_display_service_tester.cc
@@ -0,0 +1,47 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/notifications/notification_display_service_tester.h" + +#include "chrome/browser/notifications/notification.h" +#include "chrome/browser/notifications/notification_display_service.h" +#include "chrome/browser/notifications/notification_display_service_factory.h" +#include "chrome/browser/notifications/stub_notification_display_service.h" +#include "chrome/browser/profiles/profile.h" +#include "components/keyed_service/core/keyed_service.h" + +NotificationDisplayServiceTester::NotificationDisplayServiceTester( + Profile* profile) + : profile_(profile) { + DCHECK(profile_); + + display_service_ = static_cast<StubNotificationDisplayService*>( + NotificationDisplayServiceFactory::GetInstance()->SetTestingFactoryAndUse( + profile_, &StubNotificationDisplayService::FactoryForTests)); +} + +NotificationDisplayServiceTester::~NotificationDisplayServiceTester() { + NotificationDisplayServiceFactory::GetInstance()->SetTestingFactory(profile_, + nullptr); +} + +std::vector<Notification> +NotificationDisplayServiceTester::GetDisplayedNotificationsForType( + NotificationCommon::Type type) { + return display_service_->GetDisplayedNotificationsForType(type); +} + +void NotificationDisplayServiceTester::RemoveNotification( + NotificationCommon::Type type, + const std::string& notification_id, + bool by_user, + bool silent) { + display_service_->RemoveNotification(type, notification_id, by_user, silent); +} + +void NotificationDisplayServiceTester::RemoveAllNotifications( + NotificationCommon::Type type, + bool by_user) { + display_service_->RemoveAllNotifications(type, by_user); +}
diff --git a/chrome/browser/notifications/notification_display_service_tester.h b/chrome/browser/notifications/notification_display_service_tester.h new file mode 100644 index 0000000..12acf589 --- /dev/null +++ b/chrome/browser/notifications/notification_display_service_tester.h
@@ -0,0 +1,51 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_TESTER_H_ +#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_TESTER_H_ + +#include <vector> + +#include "base/macros.h" +#include "chrome/browser/notifications/notification_common.h" + +class Notification; +class Profile; +class StubNotificationDisplayService; + +// Helper class that enables use of the NotificationDisplayService in tests. The +// Profile* passed when constructing an instance must outlive this class, as +// the service (or internals of the service) may be overridden. +// +// This class must only be used for testing purposes. +class NotificationDisplayServiceTester { + public: + explicit NotificationDisplayServiceTester(Profile* profile); + ~NotificationDisplayServiceTester(); + + // Synchronously gets a vector of the displayed Notifications for the |type|. + std::vector<Notification> GetDisplayedNotificationsForType( + NotificationCommon::Type type); + + // Simulates the notification identified by |notification_id| being closed due + // to external events, such as the user dismissing it when |by_user| is set. + // When |silent| is set, the notification handlers won't be informed of the + // change to immitate behaviour of operating systems that don't inform apps + // about removed notifications. + void RemoveNotification(NotificationCommon::Type type, + const std::string& notification_id, + bool by_user, + bool silent = false); + + // Removes all notifications of the given |type|. + void RemoveAllNotifications(NotificationCommon::Type type, bool by_user); + + private: + Profile* profile_; + StubNotificationDisplayService* display_service_; + + DISALLOW_COPY_AND_ASSIGN(NotificationDisplayServiceTester); +}; + +#endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_TESTER_H_
diff --git a/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc b/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc index a232dc6..55ccf5f 100644 --- a/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc +++ b/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc
@@ -21,11 +21,9 @@ #include "chrome/browser/notifications/desktop_notification_profile_util.h" #include "chrome/browser/notifications/notification.h" #include "chrome/browser/notifications/notification_common.h" -#include "chrome/browser/notifications/notification_display_service.h" -#include "chrome/browser/notifications/notification_display_service_factory.h" +#include "chrome/browser/notifications/notification_display_service_tester.h" #include "chrome/browser/notifications/notification_test_util.h" #include "chrome/browser/notifications/platform_notification_service_impl.h" -#include "chrome/browser/notifications/stub_notification_display_service.h" #include "chrome/browser/notifications/web_notification_delegate.h" #include "chrome/browser/permissions/permission_manager.h" #include "chrome/browser/permissions/permission_request_manager.h" @@ -89,25 +87,25 @@ } void SetUpOnMainThread() override { - NotificationDisplayServiceFactory::GetInstance()->SetTestingFactory( - browser()->profile(), &StubNotificationDisplayService::FactoryForTests); + display_service_tester_ = + base::MakeUnique<NotificationDisplayServiceTester>( + browser()->profile()); SiteEngagementScore::SetParamValuesForTesting(); NavigateToTestPage(std::string("/") + kTestFileName); } + void TearDown() override { + display_service_tester_.reset(); + InProcessBrowserTest::TearDown(); + } + protected: // Returns the Platform Notification Service these unit tests are for. PlatformNotificationServiceImpl* service() const { return PlatformNotificationServiceImpl::GetInstance(); } - // Returns the stub notification display service. - StubNotificationDisplayService* GetDisplayService() const { - return static_cast<StubNotificationDisplayService*>( - NotificationDisplayServiceFactory::GetForProfile(browser()->profile())); - } - // Returns a vector with the Notification objects that are being displayed // by the notification display service. Synchronous. std::vector<Notification> GetDisplayedNotifications( @@ -116,7 +114,7 @@ ? NotificationCommon::PERSISTENT : NotificationCommon::NON_PERSISTENT; - return GetDisplayService()->GetDisplayedNotificationsForType(type); + return display_service_tester_->GetDisplayedNotificationsForType(type); } // Grants permission to display Web Notifications for origin of the test @@ -196,6 +194,7 @@ } const base::FilePath server_root_; + std::unique_ptr<NotificationDisplayServiceTester> display_service_tester_; private: std::unique_ptr<net::EmbeddedTestServer> https_server_; @@ -672,7 +671,7 @@ ASSERT_TRUE( base::StartsWith(notification.id(), "p:", base::CompareCase::SENSITIVE)); - GetDisplayService()->RemoveNotification( + display_service_tester_->RemoveNotification( NotificationCommon::PERSISTENT, notification.delegate_id(), false /* by_user */, true /* silent */);
diff --git a/chrome/browser/notifications/platform_notification_service_unittest.cc b/chrome/browser/notifications/platform_notification_service_unittest.cc index ddeee14..64aa4e9 100644 --- a/chrome/browser/notifications/platform_notification_service_unittest.cc +++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -10,30 +10,22 @@ #include "base/feature_list.h" #include "base/macros.h" #include "base/memory/ptr_util.h" -#include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" -#include "base/threading/platform_thread.h" #include "base/time/time.h" #include "build/build_config.h" -#include "chrome/browser/content_settings/host_content_settings_map_factory.h" -#include "chrome/browser/notifications/notification_display_service.h" -#include "chrome/browser/notifications/notification_display_service_factory.h" -#include "chrome/browser/notifications/notification_test_util.h" +#include "chrome/browser/notifications/notification_display_service_tester.h" #include "chrome/browser/notifications/platform_notification_service_impl.h" -#include "chrome/browser/notifications/stub_notification_display_service.h" #include "chrome/browser/notifications/web_notification_delegate.h" #include "chrome/common/chrome_features.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" -#include "components/content_settings/core/browser/host_content_settings_map.h" #include "content/public/common/notification_resources.h" #include "content/public/common/platform_notification_data.h" #include "content/public/test/test_browser_thread_bundle.h" #include "extensions/features/features.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "base/command_line.h" @@ -45,6 +37,7 @@ #include "extensions/common/extension_builder.h" #include "extensions/common/permissions/api_permission.h" #include "extensions/common/value_builder.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" #endif using content::NotificationResources; @@ -64,32 +57,28 @@ TestingBrowserProcess::GetGlobal()); ASSERT_TRUE(profile_manager_->SetUp()); profile_ = profile_manager_->CreateTestingProfile("Miguel"); - - NotificationDisplayServiceFactory::GetInstance()->SetTestingFactory( - profile_, &StubNotificationDisplayService::FactoryForTests); + display_service_tester_ = + base::MakeUnique<NotificationDisplayServiceTester>(profile_); } void TearDown() override { + display_service_tester_.reset(); profile_manager_.reset(); + TestingBrowserProcess::DeleteInstance(); } protected: - // Displays a simple, fake notifications. - void CreateSimplePageNotification() const { - CreateSimplePageNotificationWithCloseClosure(nullptr); - } - - // Displays a simple, fake notification. - // The close closure may be specified if desired. + // Displays a simple, fake notification. The close closure may be specified if + // desired. void CreateSimplePageNotificationWithCloseClosure( - base::Closure* close_closure) const { + base::Closure* close_closure) { PlatformNotificationData notification_data; notification_data.title = base::ASCIIToUTF16("My Notification"); notification_data.body = base::ASCIIToUTF16("Hello, world!"); service()->DisplayNotification( - profile(), kNotificationId, GURL("https://chrome.com/"), + profile_, kNotificationId, GURL("https://chrome.com/"), notification_data, NotificationResources(), close_closure); } @@ -98,32 +87,26 @@ return PlatformNotificationServiceImpl::GetInstance(); } - // Returns the stub notification display service. - StubNotificationDisplayService* GetDisplayService() const { - return static_cast<StubNotificationDisplayService*>( - NotificationDisplayServiceFactory::GetForProfile(profile_)); - } - - // Returns the Profile to be used for these tests. - Profile* profile() const { return profile_; } - size_t GetNotificationCountForType(NotificationCommon::Type type) { - return GetDisplayService()->GetDisplayedNotificationsForType(type).size(); + return display_service_tester_->GetDisplayedNotificationsForType(type) + .size(); } Notification GetDisplayedNotificationForType(NotificationCommon::Type type) { std::vector<Notification> notifications = - GetDisplayService()->GetDisplayedNotificationsForType(type); + display_service_tester_->GetDisplayedNotificationsForType(type); DCHECK_EQ(1u, notifications.size()); return notifications[0]; } - private: + protected: + content::TestBrowserThreadBundle thread_bundle_; + std::unique_ptr<TestingProfileManager> profile_manager_; TestingProfile* profile_; - content::TestBrowserThreadBundle thread_bundle_; - std::unique_ptr<std::set<std::string>> displayed_notifications_; + + std::unique_ptr<NotificationDisplayServiceTester> display_service_tester_; }; @@ -149,7 +132,7 @@ notification_data.body = base::ASCIIToUTF16("Hello, world!"); service()->DisplayPersistentNotification( - profile(), kNotificationId, GURL() /* service_worker_scope */, + profile_, kNotificationId, GURL() /* service_worker_scope */, GURL("https://chrome.com/"), notification_data, NotificationResources()); ASSERT_EQ(1u, GetNotificationCountForType(NotificationCommon::PERSISTENT)); @@ -162,7 +145,7 @@ EXPECT_EQ("Hello, world!", base::UTF16ToUTF8(notification.message())); - service()->ClosePersistentNotification(profile(), kNotificationId); + service()->ClosePersistentNotification(profile_, kNotificationId); EXPECT_EQ(0u, GetNotificationCountForType(NotificationCommon::PERSISTENT)); } @@ -177,7 +160,7 @@ notification_data.vibration_pattern = vibration_pattern; notification_data.silent = true; - service()->DisplayNotification(profile(), kNotificationId, + service()->DisplayNotification(profile_, kNotificationId, GURL("https://chrome.com/"), notification_data, NotificationResources(), nullptr); @@ -220,7 +203,7 @@ notification_resources.action_icons.resize(notification_data.actions.size()); service()->DisplayPersistentNotification( - profile(), kNotificationId, GURL() /* service_worker_scope */, + profile_, kNotificationId, GURL() /* service_worker_scope */, GURL("https://chrome.com/"), notification_data, notification_resources); ASSERT_EQ(1u, GetNotificationCountForType(NotificationCommon::PERSISTENT)); @@ -248,7 +231,7 @@ TEST_F(PlatformNotificationServiceTest, DisplayNameForContextMessage) { base::string16 display_name = service()->DisplayNameForContextMessage( - profile(), GURL("https://chrome.com/")); + profile_, GURL("https://chrome.com/")); EXPECT_TRUE(display_name.empty()); @@ -265,11 +248,11 @@ .Build(); extensions::ExtensionRegistry* registry = - extensions::ExtensionRegistry::Get(profile()); + extensions::ExtensionRegistry::Get(profile_); EXPECT_TRUE(registry->AddEnabled(extension)); display_name = service()->DisplayNameForContextMessage( - profile(), + profile_, GURL("chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html")); EXPECT_EQ("NotificationTest", base::UTF16ToUTF8(display_name)); } @@ -278,7 +261,7 @@ base::CommandLine command_line(base::CommandLine::NO_PROGRAM); extensions::TestExtensionSystem* test_extension_system = static_cast<extensions::TestExtensionSystem*>( - extensions::ExtensionSystem::Get(profile())); + extensions::ExtensionSystem::Get(profile_)); ExtensionService* extension_service = test_extension_system->CreateExtensionService( @@ -304,7 +287,7 @@ // has been added to the extension registry successfully. extension_service->AddExtension(extension.get()); extensions::ExtensionRegistry* registry = - extensions::ExtensionRegistry::Get(profile()); + extensions::ExtensionRegistry::Get(profile_); ASSERT_TRUE(registry->GetExtensionById( extension->id(), extensions::ExtensionRegistry::ENABLED)); @@ -312,16 +295,14 @@ const int kFakeRenderProcessId = 42; // Mock that the extension is running in a fake render process id. - extensions::ProcessMap::Get(profile())->Insert(extension->id(), - kFakeRenderProcessId, - -1 /* site_instance_id */); + extensions::ProcessMap::Get(profile_)->Insert( + extension->id(), kFakeRenderProcessId, -1 /* site_instance_id */); // Verify that the service indicates that permission has been granted. We only // check the UI thread-method for now, as that's the one guarding the behavior // in the browser process. EXPECT_EQ(blink::mojom::PermissionStatus::GRANTED, - service()->CheckPermissionOnUIThread(profile(), - extension->url(), + service()->CheckPermissionOnUIThread(profile_, extension->url(), kFakeRenderProcessId)); } @@ -332,9 +313,9 @@ GURL origin("https://chrome.com/"); Notification notification = service()->CreateNotificationFromData( - profile(), GURL() /* service_worker_scope */, origin, notification_data, + profile_, GURL() /* service_worker_scope */, origin, notification_data, NotificationResources(), - new WebNotificationDelegate(NotificationCommon::PERSISTENT, profile(), + new WebNotificationDelegate(NotificationCommon::PERSISTENT, profile_, "id", origin)); EXPECT_TRUE(notification.context_message().empty()); @@ -351,15 +332,15 @@ .Build(); extensions::ExtensionRegistry* registry = - extensions::ExtensionRegistry::Get(profile()); + extensions::ExtensionRegistry::Get(profile_); EXPECT_TRUE(registry->AddEnabled(extension)); notification = service()->CreateNotificationFromData( - profile(), GURL() /* service_worker_scope */, + profile_, GURL() /* service_worker_scope */, GURL("chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html"), notification_data, NotificationResources(), - new WebNotificationDelegate(NotificationCommon::EXTENSION, profile(), - "id", origin)); + new WebNotificationDelegate(NotificationCommon::EXTENSION, profile_, "id", + origin)); EXPECT_EQ("NotificationTest", base::UTF16ToUTF8(notification.context_message())); }
diff --git a/chrome/browser/notifications/stub_notification_display_service.h b/chrome/browser/notifications/stub_notification_display_service.h index 699d40af..f1a8dd3 100644 --- a/chrome/browser/notifications/stub_notification_display_service.h +++ b/chrome/browser/notifications/stub_notification_display_service.h
@@ -33,13 +33,15 @@ std::vector<Notification> GetDisplayedNotificationsForType( NotificationCommon::Type type) const; - // Removes the notification identified by |notification_id|. This can - // optionally be |silent|, which means the delegate events won't be invoked - // to imitate behaviour on operating systems that don't support such events. + // Simulates the notification identified by |notification_id| being closed due + // to external events, such as the user dismissing it when |by_user| is set. + // When |silent| is set, the notification handlers won't be informed of the + // change to immitate behaviour of operating systems that don't inform apps + // about removed notifications. void RemoveNotification(NotificationCommon::Type notification_type, const std::string& notification_id, bool by_user, - bool silent = false); + bool silent); // Removes all notifications shown by this display service. void RemoveAllNotifications(NotificationCommon::Type notification_type,
diff --git a/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc b/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc index 8c9a8d3b..6350d6e 100644 --- a/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc +++ b/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc
@@ -24,7 +24,7 @@ #include "chrome/common/chrome_content_client.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h" -#include "components/offline_pages/core/prefetch/prefetch_downloader.h" +#include "components/offline_pages/core/prefetch/prefetch_downloader_impl.h" #include "components/offline_pages/core/prefetch/prefetch_gcm_app_handler.h" #include "components/offline_pages/core/prefetch/prefetch_network_request_factory_impl.h" #include "components/offline_pages/core/prefetch/prefetch_service_impl.h" @@ -80,7 +80,7 @@ auto suggested_articles_observer = base::MakeUnique<SuggestedArticlesObserver>(); - auto prefetch_downloader = base::MakeUnique<PrefetchDownloader>( + auto prefetch_downloader = base::MakeUnique<PrefetchDownloaderImpl>( DownloadServiceFactory::GetForBrowserContext(context), chrome::GetChannel());
diff --git a/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.cc index c285d6c0..e57a2a1 100644 --- a/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.cc +++ b/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.cc
@@ -10,7 +10,9 @@ #include "chrome/browser/resource_coordinator/tab_manager.h" #include "chrome/common/page_load_metrics/page_load_metrics.mojom.h" #include "content/public/browser/navigation_handle.h" +#include "content/public/browser/restore_type.h" #include "content/public/browser/web_contents.h" +#include "ui/base/page_transition_types.h" namespace internal { @@ -37,11 +39,28 @@ // Should not be null because this is used only on supported platforms. DCHECK(tab_manager); - return (started_in_foreground && - tab_manager->IsTabInSessionRestore(contents) && - tab_manager->IsTabRestoredInForeground(contents)) - ? CONTINUE_OBSERVING - : STOP_OBSERVING; + if (!started_in_foreground || !tab_manager->IsTabInSessionRestore(contents) || + !tab_manager->IsTabRestoredInForeground(contents)) + return STOP_OBSERVING; + + // The navigation should be from the last session. + DCHECK(navigation_handle->GetRestoreType() == + content::RestoreType::LAST_SESSION_EXITED_CLEANLY || + navigation_handle->GetRestoreType() == + content::RestoreType::LAST_SESSION_CRASHED); + + return CONTINUE_OBSERVING; +} + +page_load_metrics::PageLoadMetricsObserver::ObservePolicy +SessionRestorePageLoadMetricsObserver::OnCommit( + content::NavigationHandle* navigation_handle, + ukm::SourceId source_id) { + // Session restores use transition reload, so we only observe loads with a + // reload transition type. + DCHECK(ui::PageTransitionCoreTypeIs(navigation_handle->GetPageTransition(), + ui::PAGE_TRANSITION_RELOAD)); + return CONTINUE_OBSERVING; } void SessionRestorePageLoadMetricsObserver::OnFirstPaintInPage(
diff --git a/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.h b/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.h index f8c50118..c786b03 100644 --- a/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.h +++ b/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.h
@@ -28,6 +28,8 @@ ObservePolicy OnStart(content::NavigationHandle* navigation_handle, const GURL& currently_committed_url, bool started_in_foreground) override; + ObservePolicy OnCommit(content::NavigationHandle* navigation_handle, + ukm::SourceId source_id) override; void OnFirstPaintInPage( const page_load_metrics::mojom::PageLoadTiming& timing, const page_load_metrics::PageLoadExtraInfo& extra_info) override;
diff --git a/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer_unittest.cc index 724832d4..7c9a3d0 100644 --- a/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.h" #include <memory> +#include <string> #include <unordered_map> #include <utility> #include <vector> @@ -20,19 +21,19 @@ #include "chrome/browser/page_load_metrics/page_load_tracker.h" #include "chrome/browser/resource_coordinator/tab_manager.h" #include "chrome/browser/sessions/session_restore.h" -#include "chrome/browser/sessions/tab_loader.h" #include "chrome/common/page_load_metrics/test/page_load_metrics_test_util.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_profile.h" #include "content/public/browser/browser_url_handler.h" #include "content/public/browser/navigation_controller.h" +#include "content/public/browser/navigation_entry.h" #include "content/public/browser/web_contents.h" +#include "content/public/common/referrer.h" #include "content/public/test/navigation_simulator.h" #include "content/public/test/web_contents_tester.h" #include "ui/base/page_transition_types.h" #include "url/gurl.h" -using RestoredTab = SessionRestoreDelegate::RestoredTab; using WebContents = content::WebContents; class SessionRestorePageLoadMetricsObserverTest @@ -86,11 +87,7 @@ base::BindRepeating( &SessionRestorePageLoadMetricsObserverTest::RegisterObservers)); testers_[contents] = std::move(tester); - restored_tabs_.emplace_back(contents, false /* is_active */, - false /* is_app */, false /* is_pinned */); - NavigateAndCommit(contents, GetTestURL()); contents->WasShown(); - StopLoading(contents); return contents; } @@ -111,8 +108,26 @@ expected_total_count); } - void RestoreTabs() { - TabLoader::RestoreTabs(restored_tabs_, base::TimeTicks()); + void RestoreTab(WebContents* contents) { + SessionRestore::OnWillRestoreTab(contents); + + // Create a restored navigation entry. + std::vector<std::unique_ptr<content::NavigationEntry>> entries; + std::unique_ptr<content::NavigationEntry> entry( + content::NavigationController::CreateNavigationEntry( + GetTestURL(), content::Referrer(), ui::PAGE_TRANSITION_RELOAD, + false, std::string(), browser_context())); + entries.emplace_back(std::move(entry)); + + content::NavigationController& controller = contents->GetController(); + controller.Restore(0, content::RestoreType::LAST_SESSION_EXITED_CLEANLY, + &entries); + ASSERT_EQ(0u, entries.size()); + ASSERT_EQ(1, controller.GetEntryCount()); + + EXPECT_TRUE(controller.NeedsReload()); + controller.LoadIfNecessary(); + content::WebContentsTester::For(contents)->CommitPendingNavigation(); } void SimulateTimingUpdateForTab(WebContents* contents) { @@ -120,29 +135,12 @@ testers_[contents]->SimulateTimingUpdate(timing_); } - void StopLoading(WebContents* contents) const { - contents->Stop(); - content::WebContentsTester::For(contents)->TestSetIsLoading(false); - } - - void NavigateAndCommit(WebContents* contents, const GURL& url) const { - content::NavigationSimulator::NavigateAndCommitFromDocument( - GetTestURL(), contents->GetMainFrame()); - } - GURL GetTestURL() const { return GURL("https://google.com"); } - const page_load_metrics::mojom::PageLoadTiming& timing() const { - return timing_; - } - - std::vector<RestoredTab>& restored_tabs() { return restored_tabs_; } - private: base::HistogramTester histogram_tester_; page_load_metrics::mojom::PageLoadTiming timing_; - std::vector<RestoredTab> restored_tabs_; std::vector<std::unique_ptr<WebContents>> tabs_; std::unordered_map< WebContents*, @@ -158,35 +156,27 @@ TEST_F(SessionRestorePageLoadMetricsObserverTest, FirstPaintsOutOfSessionRestore) { - NavigateAndCommit(web_contents(), GetTestURL()); + content::NavigationSimulator::NavigateAndCommitFromDocument( + GetTestURL(), web_contents()->GetMainFrame()); ASSERT_NO_FATAL_FAILURE(SimulateTimingUpdateForTab(web_contents())); ExpectFirstPaintMetricsTotalCount(0); } TEST_F(SessionRestorePageLoadMetricsObserverTest, RestoreSingleForegroundTab) { // Restore one tab which finishes loading in foreground. - SessionRestore::OnWillRestoreTab(web_contents()); - RestoreTabs(); - NavigateAndCommit(web_contents(), GetTestURL()); + ASSERT_NO_FATAL_FAILURE(RestoreTab(web_contents())); ASSERT_NO_FATAL_FAILURE(SimulateTimingUpdateForTab(web_contents())); ExpectFirstPaintMetricsTotalCount(1); } TEST_F(SessionRestorePageLoadMetricsObserverTest, RestoreMultipleForegroundTabs) { - WebContents* second_contents = AddForegroundTabWithTester(); - // Restore each tab separately. - std::vector<std::vector<RestoredTab>> restored_tabs_list{ - std::vector<RestoredTab>{ - RestoredTab(web_contents(), false, false, false)}, - std::vector<RestoredTab>{ - RestoredTab(second_contents, false, false, false)}}; + AddForegroundTabWithTester(); + // Restore each tab separately. for (size_t i = 0; i < tabs().size(); ++i) { WebContents* contents = tabs()[i].get(); - SessionRestore::OnWillRestoreTab(contents); - TabLoader::RestoreTabs(restored_tabs_list[i], base::TimeTicks()); - NavigateAndCommit(contents, GetTestURL()); + ASSERT_NO_FATAL_FAILURE(RestoreTab(contents)); ASSERT_NO_FATAL_FAILURE(SimulateTimingUpdateForTab(contents)); ExpectFirstPaintMetricsTotalCount(i + 1); } @@ -197,9 +187,7 @@ web_contents()->WasHidden(); // Load the restored tab in background. - SessionRestore::OnWillRestoreTab(web_contents()); - RestoreTabs(); - NavigateAndCommit(web_contents(), GetTestURL()); + ASSERT_NO_FATAL_FAILURE(RestoreTab(web_contents())); ASSERT_NO_FATAL_FAILURE(SimulateTimingUpdateForTab(web_contents())); // No paint timings recorded for tabs restored in background. @@ -208,15 +196,13 @@ TEST_F(SessionRestorePageLoadMetricsObserverTest, HideTabBeforeFirstPaints) { // Start loading the tab. - SessionRestore::OnWillRestoreTab(web_contents()); - RestoreTabs(); - NavigateAndCommit(web_contents(), GetTestURL()); + ASSERT_NO_FATAL_FAILURE(RestoreTab(web_contents())); // Hide the tab before any paints. web_contents()->WasHidden(); - ASSERT_NO_FATAL_FAILURE(SimulateTimingUpdateForTab(web_contents())); // No paint timings recorded because tab was hidden before the first paints. + ASSERT_NO_FATAL_FAILURE(SimulateTimingUpdateForTab(web_contents())); ExpectFirstPaintMetricsTotalCount(0); } @@ -224,40 +210,31 @@ SwitchInitialRestoredForegroundTab) { // Create 2 tabs: tab 0 is foreground, tab 1 is background. AddForegroundTabWithTester(); - restored_tabs()[0].contents()->WasShown(); - restored_tabs()[1].contents()->WasHidden(); + tabs()[0]->WasShown(); + tabs()[1]->WasHidden(); // Restore both tabs. for (size_t i = 0; i < tabs().size(); ++i) - SessionRestore::OnWillRestoreTab(tabs()[i].get()); - TabLoader::RestoreTabs(restored_tabs(), base::TimeTicks()); - - for (size_t i = 0; i < tabs().size(); ++i) - NavigateAndCommit(tabs()[i].get(), GetTestURL()); + ASSERT_NO_FATAL_FAILURE(RestoreTab(tabs()[i].get())); // Switch to tab 1 before any paint events occur. - restored_tabs()[0].contents()->WasHidden(); - restored_tabs()[1].contents()->WasShown(); - ASSERT_NO_FATAL_FAILURE(SimulateTimingUpdateForTab(web_contents())); + tabs()[0]->WasHidden(); + tabs()[1]->WasShown(); // No paint timings recorded because the initial foreground tab was hidden. + ASSERT_NO_FATAL_FAILURE(SimulateTimingUpdateForTab(web_contents())); ExpectFirstPaintMetricsTotalCount(0); } TEST_F(SessionRestorePageLoadMetricsObserverTest, MultipleSessionRestores) { size_t number_of_session_restores = 3; for (size_t i = 1; i <= number_of_session_restores; ++i) { - // Restore session. - SessionRestore::OnWillRestoreTab(web_contents()); - RestoreTabs(); - NavigateAndCommit(web_contents(), GetTestURL()); - ASSERT_NO_FATAL_FAILURE(SimulateTimingUpdateForTab(web_contents())); + // NavigationController needs to be unused to restore. + WebContents* contents = AddForegroundTabWithTester(); + ASSERT_NO_FATAL_FAILURE(RestoreTab(contents)); + ASSERT_NO_FATAL_FAILURE(SimulateTimingUpdateForTab(contents)); // Number of paint timings should match the number of session restores. ExpectFirstPaintMetricsTotalCount(i); - - // Clear committed URL for the next restore starts from an empty URL. - NavigateAndCommit(web_contents(), GURL()); - StopLoading(web_contents()); } }
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.cc b/chrome/browser/payments/chrome_payment_request_delegate.cc index 06ce410..416cc4f 100644 --- a/chrome/browser/payments/chrome_payment_request_delegate.cc +++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
@@ -71,8 +71,11 @@ autofill::PersonalDataManager* ChromePaymentRequestDelegate::GetPersonalDataManager() { + // Autofill uses the original profile's PersonalDataManager to make data + // available in incognito, so PaymentRequest should do the same. return autofill::PersonalDataManagerFactory::GetForProfile( - Profile::FromBrowserContext(web_contents_->GetBrowserContext())); + Profile::FromBrowserContext(web_contents_->GetBrowserContext()) + ->GetOriginalProfile()); } const std::string& ChromePaymentRequestDelegate::GetApplicationLocale() const {
diff --git a/chrome/browser/profiling_host/profiling_process_host.cc b/chrome/browser/profiling_host/profiling_process_host.cc index 4b267eb..39fb814 100644 --- a/chrome/browser/profiling_host/profiling_process_host.cc +++ b/chrome/browser/profiling_host/profiling_process_host.cc
@@ -99,7 +99,8 @@ memlog_->AddSender( pid, - mojo::WrapPlatformFile(data_channel.PassServerHandle().release().handle)); + mojo::WrapPlatformFile(data_channel.PassServerHandle().release().handle), + base::OnceCallback<void()>()); memlog_client->StartProfiling( mojo::WrapPlatformFile(data_channel.PassClientHandle().release().handle)); } @@ -158,11 +159,15 @@ connector_->BindInterface(mojom::kServiceName, &memlog_); mojo::edk::PlatformChannelPair data_channel; + // Unretained is safe because this class is a leaaky singleton that owns the + // client object. memlog_->AddSender( base::Process::Current().Pid(), - mojo::WrapPlatformFile(data_channel.PassServerHandle().release().handle)); - memlog_client_.StartProfiling( - mojo::WrapPlatformFile(data_channel.PassClientHandle().release().handle)); + mojo::WrapPlatformFile(data_channel.PassServerHandle().release().handle), + base::BindOnce(&MemlogClient::StartProfiling, + base::Unretained(&memlog_client_), + mojo::WrapPlatformFile( + data_channel.PassClientHandle().release().handle))); } void ProfilingProcessHost::GetOutputFileOnBlockingThread(base::ProcessId pid) {
diff --git a/chrome/browser/resources/chromeos/arc_support/playstore.js b/chrome/browser/resources/chromeos/arc_support/playstore.js index a0d052dd..0bde6ca 100644 --- a/chrome/browser/resources/chromeos/arc_support/playstore.js +++ b/chrome/browser/resources/chromeos/arc_support/playstore.js
@@ -3,54 +3,65 @@ // found in the LICENSE file. /** + * Analyzes current document and tries to find the link to the Play Store ToS + * that matches requested |language| and |countryCode|. Once found, navigate + * to this link and returns True. If no match was found then returns False. + */ +function navigateToLanguageAndCountryCode(language, countryCode) { + var doc = document; + var selectLangZoneTerms = + doc.getElementById('play-footer').getElementsByTagName('select')[0]; + + var applyTermsForLangAndZone = function(termsLang) { + var matchByLangZone = + '/intl/' + termsLang + '_' + countryCode + '/about/play-terms.html'; + for (var i = selectLangZoneTerms.options.length - 1; i >= 0; --i) { + var option = selectLangZoneTerms.options[i]; + if (option.value == matchByLangZone) { + window.location.href = option.value; + return true; + } + } + return false; + }; + + // Try two versions of the language, full and short (if it exists, for + // example en-GB -> en). Note, terms may contain entries for both types, for + // example: en_ie, es-419_ar, es_as, pt-PT_pt. + if (applyTermsForLangAndZone(language)) { + return true; + } + var langSegments = language.split('-'); + if (langSegments.length == 2 && applyTermsForLangAndZone(langSegments[0])) { + return true; + } + + return false; +} + +/** * Processes select tag that contains list of available terms for different * languages and zones. In case of initial load, tries to find terms that match * exactly current language and country code and automatically redirects the * view in case such terms are found. Leaves terms in select tag that only match * current language or country code or default English variant or currently - * selected. Note that document.countryCode must be set before calling this - * function. + * selected. + * + * @return {boolean} True. */ -function processLangZoneTerms() { - var doc = document; - var selectLangZoneTerms = - doc.getElementById('play-footer').getElementsByTagName('select')[0]; - - var initialLoad = - window.location.href == 'https://play.google.com/about/play-terms.html'; - var langSegments = navigator.language.split('-'); - if (initialLoad) { - var applyTermsForLangAndZone = function(termsLang) { - var matchByLangZone = '/intl/' + termsLang + '_' + document.countryCode + - '/about/play-terms.html'; - for (var i = selectLangZoneTerms.options.length - 1; i >= 0; --i) { - var option = selectLangZoneTerms.options[i]; - if (option.value == matchByLangZone) { - window.location.href = option.value; - return true; - } - } - return false; - }; - - // Try two versions of the language, full and short (if it exists, for - // example en-GB -> en). Note, terms may contain entries for both types, for - // example: en_ie, es-419_ar, es_as, pt-PT_pt. - if (applyTermsForLangAndZone(navigator.language)) { - return; - } - if (langSegments.length == 2 && applyTermsForLangAndZone(langSegments[0])) { - return; - } +function processLangZoneTerms(initialLoad, language, countryCode) { + var langSegments = language.split('-'); + if (initialLoad && navigateToLanguageAndCountryCode(language, countryCode)) { + return true; } - var matchByLang = '/intl/' + navigator.language + '_'; + var matchByLang = '/intl/' + language + '_'; var matchByLangShort = null; if (langSegments.length == 2) { matchByLangShort = '/intl/' + langSegments[0] + '_'; } - var matchByZone = '_' + document.countryCode + '/about/play-terms.html'; + var matchByZone = '_' + countryCode + '/about/play-terms.html'; var matchByDefault = '/intl/en/about/play-terms.html'; // We are allowed to display terms by default only in language that matches @@ -58,6 +69,9 @@ var langMatch = false; var defaultExist = false; + var doc = document; + var selectLangZoneTerms = + doc.getElementById('play-footer').getElementsByTagName('select')[0]; for (var i = selectLangZoneTerms.options.length - 1; i >= 0; --i) { var option = selectLangZoneTerms.options[i]; if (selectLangZoneTerms.selectedIndex == i) { @@ -69,19 +83,20 @@ defaultExist = true; continue; } - if (!option.value.startsWith(matchByLang) && + + option.hidden = !option.value.startsWith(matchByLang) && !option.value.endsWith(matchByZone) && !(matchByLangShort && option.value.startsWith(matchByLangShort)) && - option.text != 'English') { - selectLangZoneTerms.removeChild(option); - } + option.text != 'English'; } + if (initialLoad && !langMatch && defaultExist) { window.location.href = matchByDefault; } else { // Show content once we reached target url. document.body.hidden = false; } + return true; } /** @@ -131,5 +146,26 @@ return 'https://www.google.com/policies/privacy/'; } -formatDocument(); -processLangZoneTerms(); +/** + * Processes the current document by applying required formatting and selected + * right PlayStore ToS. + * Note that document.countryCode must be set before calling this function. + */ +function processDocument() { + if (document.wasProcessed) { + return; + } + formatDocument(); + + var initialLoad = + window.location.href == 'https://play.google.com/about/play-terms.html'; + var language = document.language; + if (!language) { + language = navigator.language; + } + + processLangZoneTerms(initialLoad, language, document.countryCode); + document.wasProcessed = true; +} + +processDocument();
diff --git a/chrome/browser/resources/chromeos/certificate_manager_dialog.html b/chrome/browser/resources/chromeos/certificate_manager_dialog.html index b9650234..0879440 100644 --- a/chrome/browser/resources/chromeos/certificate_manager_dialog.html +++ b/chrome/browser/resources/chromeos/certificate_manager_dialog.html
@@ -1,67 +1,18 @@ <!doctype html> -<html i18n-values="dir:textdirection;lang:language;highlight:highlightStrength"> -<head> -<meta charset="utf-8"> -<link rel="stylesheet" href="chrome://resources/css/bubble.css"> -<link rel="stylesheet" href="chrome://resources/css/bubble_button.css"> -<link rel="stylesheet" href="chrome://resources/css/chrome_shared.css"> -<link rel="stylesheet" href="chrome://resources/css/controlled_indicator.css"> -<link rel="stylesheet" href="chrome://resources/css/list.css"> -<link rel="stylesheet" href="chrome://resources/css/overlay.css"> -<link rel="stylesheet" href="chrome://resources/css/tree.css"> -<link rel="stylesheet" href="chrome://resources/css/widgets.css"> -<link rel="stylesheet" href="../options/options_page.css"> -<link rel="stylesheet" href="../options/certificate_manager.css"> -<link rel="stylesheet" href="../options/alert_overlay.css"> -<link rel="stylesheet" href="../options/certificate_tree.css"> -<link rel="stylesheet" href="../options/subpages_tab_controls.css"> -<script src="chrome://resources/js/cr.js"></script> -<script src="chrome://resources/js/event_tracker.js"></script> -<script src="chrome://resources/js/cr/event_target.js"></script> -<script src="chrome://resources/js/cr/ui.js"></script> -<script src="chrome://resources/js/cr/ui/focus_manager.js"></script> -<script src="chrome://resources/js/cr/ui/focus_outline_manager.js"></script> -<script src="chrome://resources/js/cr/ui/touch_handler.js"></script> -<script src="chrome://resources/js/cr/ui/array_data_model.js"></script> -<script src="chrome://resources/js/cr/ui/bubble.js"></script> -<script src="chrome://resources/js/cr/ui/bubble_button.js"></script> -<script src="chrome://resources/js/cr/ui/controlled_indicator.js"></script> -<script src="chrome://resources/js/cr/ui/list_selection_model.js"></script> -<script src="chrome://resources/js/cr/ui/list_selection_controller.js"></script> -<script src="chrome://resources/js/cr/ui/list_single_selection_model.js"></script> -<script src="chrome://resources/js/cr/ui/list_item.js"></script> -<script src="chrome://resources/js/cr/ui/list.js"></script> -<script src="chrome://resources/js/cr/ui/overlay.js"></script> -<script src="chrome://resources/js/cr/ui/page_manager/page_manager.js"></script> -<script src="chrome://resources/js/cr/ui/page_manager/page.js"></script> -<script src="chrome://resources/js/cr/ui/tree.js"></script> -<script src="chrome://resources/js/load_time_data.js"></script> -<script src="chrome://resources/js/util.js"></script> +<html i18n-values="dir:textdirection;lang:language"> -<script src="../options/options_page.js"></script> -<script src="../options/alert_overlay.js"></script> -<script src="../options/controlled_setting.js"></script> -<script src="../options/certificate_tree.js"></script> -<script src="../options/certificate_manager.js"></script> -<script src="../options/certificate_restore_overlay.js"></script> -<script src="../options/certificate_backup_overlay.js"></script> -<script src="../options/certificate_edit_ca_trust_overlay.js"></script> -<script src="../options/certificate_import_error_overlay.js"></script> -<script src="keyboard/keyboard_utils.js"></script> -<script src="certificate_manager_dialog.js"></script> -<script src="chrome://certificate-manager/strings.js"></script> -</head> + <head> + <meta charset="utf-8"> + <link rel="import" href="chrome://resources/cr_components/certificate_manager/certificate_manager.html"> + <link rel="import" href="chrome://resources/html/cr.html"> + <link rel="import" href="chrome://resources/html/load_time_data.html"> + <link rel="import" href="chrome://resources/html/util.html"> + <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> + <script src="chrome://certificate-manager/strings.js"></script> + </head> -<body> - <include src="../options/certificate_manager.html"> - <div id="overlay-container-2" class="overlay transparent" hidden> - <include src="../options/alert_overlay.html"> - <include src="../options/certificate_restore_overlay.html"> - <include src="../options/certificate_backup_overlay.html"> - <include src="../options/certificate_edit_ca_trust_overlay.html"> - <include src="../options/certificate_import_error_overlay.html"> - </div> - <div id="page-container" hidden></div> -<script src="chrome://resources/js/i18n_template.js"></script> -</body> + <body> + <certificate-manager></certificate-manager> + </body> + </html>
diff --git a/chrome/browser/resources/chromeos/certificate_manager_dialog.js b/chrome/browser/resources/chromeos/certificate_manager_dialog.js deleted file mode 100644 index 7043be3..0000000 --- a/chrome/browser/resources/chromeos/certificate_manager_dialog.js +++ /dev/null
@@ -1,69 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -var AlertOverlay = options.AlertOverlay; -var OptionsPage = options.OptionsPage; -var PageManager = cr.ui.pageManager.PageManager; -var CertificateManager = options.CertificateManager; -var CertificateRestoreOverlay = options.CertificateRestoreOverlay; -var CertificateBackupOverlay = options.CertificateBackupOverlay; -var CertificateEditCaTrustOverlay = options.CertificateEditCaTrustOverlay; -var CertificateImportErrorOverlay = options.CertificateImportErrorOverlay; - -/** - * DOMContentLoaded handler, sets up the page. - */ -function load() { - if (cr.isChromeOS) - document.documentElement.setAttribute('os', 'chromeos'); - - // Setup tab change handers. - var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs'); - for (var i = 0; i < subpagesNavTabs.length; i++) { - subpagesNavTabs[i].onclick = function(event) { - OptionsPage.showTab(event.srcElement); - }; - } - - // Shake the dialog if the user clicks outside the dialog bounds. - var containers = [$('overlay-container-2')]; - for (var i = 0; i < containers.length; i++) { - var overlay = containers[i]; - cr.ui.overlay.setupOverlay(overlay); - overlay.addEventListener( - 'cancelOverlay', PageManager.cancelOverlay.bind(PageManager)); - } - - // Hide elements that should not be part of the dialog. - $('certificate-confirm').hidden = true; - $('cert-manager-header').hidden = true; - - PageManager.isDialog = true; - CertificateManager.getInstance().setIsKiosk(true); - CertificateManager.getInstance().initializePage(); - PageManager.registerOverlay( - AlertOverlay.getInstance(), CertificateManager.getInstance()); - PageManager.registerOverlay( - CertificateBackupOverlay.getInstance(), CertificateManager.getInstance()); - PageManager.registerOverlay( - CertificateEditCaTrustOverlay.getInstance(), - CertificateManager.getInstance()); - PageManager.registerOverlay( - CertificateImportErrorOverlay.getInstance(), - CertificateManager.getInstance()); - PageManager.registerOverlay(CertificateManager.getInstance()); - PageManager.registerOverlay( - CertificateRestoreOverlay.getInstance(), - CertificateManager.getInstance()); - - PageManager.showPageByName('certificates', false); -} - -disableTextSelectAndDrag(function(e) { - var src = e.target; - return src instanceof HTMLTextAreaElement || - src instanceof HTMLInputElement && /text|url/.test(src.type); -}); - -document.addEventListener('DOMContentLoaded', load);
diff --git a/chrome/browser/resources/chromeos/compiled_resources2.gyp b/chrome/browser/resources/chromeos/compiled_resources2.gyp index 246baf98..f5836b4 100644 --- a/chrome/browser/resources/chromeos/compiled_resources2.gyp +++ b/chrome/browser/resources/chromeos/compiled_resources2.gyp
@@ -15,100 +15,5 @@ ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, - { - 'target_name': 'certificate_manager_dialog', - 'variables': { - 'extra_inputs': [ - '<!@(python <(CLOSURE_DIR)/build/get_includes.py ../options/options_bundle.js)', - ], - 'script_args': ['--custom_sources', '--custom_includes'], - 'source_files': [ - '<(DEPTH)/third_party/jstemplate/util.js', - '<(DEPTH)/third_party/jstemplate/jsevalcontext.js', - '<(DEPTH)/third_party/jstemplate/jstemplate.js', - '<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/cr_onc_types.js', - '<(DEPTH)/ui/webui/resources/js/action_link.js', - '<(DEPTH)/ui/webui/resources/js/cr.js', - '<(DEPTH)/ui/webui/resources/js/cr/event_target.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/array_data_model.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/autocomplete_list.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/bubble.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/bubble_button.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/command.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/controlled_indicator.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/focus_manager.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/focus_outline_manager.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/focus_without_ink.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/list.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/list_item.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/list_selection_controller.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/list_selection_model.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/list_single_selection_model.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/grid.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/menu.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/menu_item.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/overlay.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/position_util.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/node_utils.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/page_manager/page.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/page_manager/page_manager.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/repeating_button.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/touch_handler.js', - '<(DEPTH)/ui/webui/resources/js/cr/ui/tree.js', - '<(DEPTH)/ui/webui/resources/js/event_tracker.js', - '<(DEPTH)/ui/webui/resources/js/icon.js', - '<(DEPTH)/ui/webui/resources/js/load_time_data.js', - '<(DEPTH)/ui/webui/resources/js/parse_html_subset.js', - '<(DEPTH)/ui/webui/resources/js/promise_resolver.js', - '<(DEPTH)/ui/webui/resources/js/util.js', - '../chromeos/keyboard/keyboard_utils.js', - '<(DEPTH)/ui/webui/resources/js/i18n_behavior.js', - '<(DEPTH)/ui/webui/resources/js/web_ui_listener_behavior.js', - '../settings/page_visibility.js', - '../settings/route.js', - '../settings/people_page/easy_unlock_browser_proxy.js', - '../settings/people_page/fingerprint_browser_proxy.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selectable-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-selector/iron-multi-selectable-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menubar-behavior-extracted.js', - '<(DEPTH)/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector_grid.js', - '<(DEPTH)/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js', - '../settings/people_page/lock_screen_constants.js', - '<(DEPTH)/third_party/closure_compiler/externs/quick_unlock_private.js', - '../settings/people_page/lock_state_behavior.js', - '../settings/people_page/password_prompt_dialog.js', - '<(DEPTH)/ui/webui/resources/js/assert.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-meta/iron-meta-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-icon/iron-icon-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-ripple-behavior-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js', - '<(DEPTH)/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button-extracted.js', - '<(DEPTH)/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js', - '../settings/people_page/lock_screen.js', - '<(DEPTH)/third_party/closure_compiler/externs/bluetooth.js', - '<(DEPTH)/third_party/closure_compiler/externs/bluetooth_private.js', - '<(DEPTH)/third_party/closure_compiler/externs/management.js', - '<(DEPTH)/third_party/closure_compiler/externs/metrics_private.js', - '<(DEPTH)/third_party/closure_compiler/externs/networking_private.js', - '<(DEPTH)/third_party/closure_compiler/externs/chrome_send.js', - '<(DEPTH)/third_party/closure_compiler/externs/web_animations.js', - '<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/cr_network_icon_externs.js', - '../options/options_bundle.js', - # Note: ^ this is just a copy of - # ../options/compiled_resources2.gyp:options_bundle#source_files. Most - # of this code is deprecated, but please keep in sync if you really - # need to change. - 'certificate_manager_dialog.js', - ], - }, - 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], - }, ], }
diff --git a/chrome/browser/resources/chromeos/login/screen_arc_terms_of_service.js b/chrome/browser/resources/chromeos/login/screen_arc_terms_of_service.js index edd6873e..2d2f103 100644 --- a/chrome/browser/resources/chromeos/login/screen_arc_terms_of_service.js +++ b/chrome/browser/resources/chromeos/login/screen_arc_terms_of_service.js
@@ -10,12 +10,40 @@ return { EXTERNAL_API: [ 'setMetricsMode', 'setBackupAndRestoreMode', 'setLocationServicesMode', - 'setCountryCode' + 'loadPlayStoreToS' ], /** @override */ decorate: function(element) { // Valid newOobeUI is not available at this time. + this.countryCode_ = null; + this.language_ = null; + }, + + /** + * Returns current language that can be updated in OOBE flow. If OOBE flow + * does not exist then use navigator.language. + * + * @private + */ + getCurrentLanguage_: function() { + var languageList = loadTimeData.getValue('languageList'); + if (languageList) { + var language = Oobe.getSelectedValue(languageList); + if (language) { + return language; + } + } + return navigator.language; + }, + + /** + * Returns true if page was intialized. + * + * @private + */ + isPageReady_: function() { + return typeof this.useMDOobe !== 'undefined'; }, /** @@ -25,8 +53,7 @@ */ setMDMode_: function() { var useMDOobe = (loadTimeData.getString('newOobeUI') == 'on'); - if (typeof this.useMDOobe !== 'undefined' && - this.useMDOobe == useMDOobe) { + if (this.isPageReady_() && this.useMDOobe == useMDOobe) { return; } @@ -75,17 +102,8 @@ typeof results[0] == 'string') { self.showUrlOverlay(results[0]); } else { - // currentLanguage can be updated in OOBE but not in Login page. - // languageList exists in OOBE otherwise use navigator.language. - var currentLanguage; - var languageList = loadTimeData.getValue('languageList'); - if (languageList) { - currentLanguage = Oobe.getSelectedValue(languageList); - } else { - currentLanguage = navigator.language; - } var defaultLink = 'https://www.google.com/intl/' + - currentLanguage + '/policies/privacy/'; + self.getCurrentLanguage_() + '/policies/privacy/'; self.showUrlOverlay(defaultLink); } }); @@ -148,15 +166,35 @@ }, /** - * Sets current country code for ToS. + * Loads Play Store ToS in case country code has been changed or previous + * attempt failed. * @param {string} countryCode Country code based on current timezone. */ - setCountryCode: function(countryCode) { + loadPlayStoreToS: function(countryCode) { + // Make sure page is initialized for login mode. For OOBE mode, page is + // initialized as result of handling updateLocalizedContent. + this.setMDMode_(); + + var language = this.getCurrentLanguage_(); + countryCode = countryCode.toLowerCase(); + + if (this.language_ && this.language_ == language && this.countryCode_ && + this.countryCode_ == countryCode && + !this.classList.contains('error')) { + return; + } + + // Store current ToS parameters. + this.language_ = language; + this.countryCode_ = countryCode; + var scriptSetParameters = - 'document.countryCode = \'' + countryCode.toLowerCase() + '\';'; + 'document.countryCode = \'' + countryCode + '\';'; + scriptSetParameters += 'document.language = \'' + language + '\';'; if (this.useMDOobe) { scriptSetParameters += 'document.viewMode = \'large-view\';'; } + var termsView = this.getElement_('arc-tos-view'); termsView.removeContentScripts(['preProcess']); termsView.addContentScripts([{ @@ -166,9 +204,21 @@ run_at: 'document_start' }]); - if (!$('arc-tos').hidden) { - this.reloadPlayStore(); + // Try to use currently loaded document first. + var self = this; + if (termsView.src != '' && this.classList.contains('arc-tos-loaded')) { + var navigateScript = 'processLangZoneTerms(true, \'' + language + + '\', \'' + countryCode + '\');'; + termsView.executeScript({code: navigateScript}, function(results) { + if (!results || results.length != 1 || + typeof results[0] !== 'boolean' || !results[0]) { + self.reloadPlayStoreToS(); + } + }); + } else { + this.reloadPlayStoreToS(); } + }, /** @@ -191,7 +241,7 @@ retryButton.id = 'arc-tos-retry-button'; retryButton.textContent = loadTimeData.getString('arcTermsOfServiceRetryButton'); - retryButton.addEventListener('click', this.reloadPlayStore.bind(this)); + retryButton.addEventListener('click', this.reloadPlayStoreToS.bind(this)); buttons.push(retryButton); var acceptButton = this.ownerDocument.createElement('button'); @@ -288,9 +338,9 @@ }, /** - * Reloads Play Store. + * Reloads Play Store ToS. */ - reloadPlayStore: function() { + reloadPlayStoreToS: function() { this.termsError = false; var termsView = this.getElement_('arc-tos-view'); termsView.src = 'https://play.google.com/about/play-terms.html'; @@ -372,7 +422,6 @@ * @param {object} data Screen init payload. */ onBeforeShow: function(data) { - this.setMDMode_(); this.setLearnMoreHandlers_(); Oobe.getInstance().headerHidden = true; @@ -383,7 +432,6 @@ 'https://play.google.com/about/images/play_logo.png'; this.hideOverlay(); - this.reloadPlayStore(); }, /** @@ -406,6 +454,11 @@ updateLocalizedContent: function() { this.setMDMode_(); this.setLearnMoreHandlers_(); + + // We might need to reload Play Store ToS in case language was changed. + if (this.countryCode_) { + this.loadPlayStoreToS(this.countryCode_); + } }, /**
diff --git a/chrome/browser/sessions/tab_loader_delegate.cc b/chrome/browser/sessions/tab_loader_delegate.cc index 72ba8ddd..5d62106 100644 --- a/chrome/browser/sessions/tab_loader_delegate.cc +++ b/chrome/browser/sessions/tab_loader_delegate.cc
@@ -25,7 +25,7 @@ class TabLoaderDelegateImpl : public TabLoaderDelegate, - public net::NetworkChangeNotifier::ConnectionTypeObserver { + public net::NetworkChangeNotifier::NetworkChangeObserver { public: explicit TabLoaderDelegateImpl(TabLoaderCallback* callback); ~TabLoaderDelegateImpl() override; @@ -40,8 +40,8 @@ return timeout_; } - // net::NetworkChangeNotifier::ConnectionTypeObserver: - void OnConnectionTypeChanged( + // net::NetworkChangeNotifier::NetworkChangeObserver implementation: + void OnNetworkChanged( net::NetworkChangeNotifier::ConnectionType type) override; private: @@ -57,7 +57,7 @@ TabLoaderDelegateImpl::TabLoaderDelegateImpl(TabLoaderCallback* callback) : callback_(callback) { - net::NetworkChangeNotifier::AddConnectionTypeObserver(this); + net::NetworkChangeNotifier::AddNetworkChangeObserver(this); if (net::NetworkChangeNotifier::IsOffline()) { // When we are off-line we do not allow loading of tabs, since each of // these tabs would start loading simultaneously when going online. @@ -71,14 +71,15 @@ } TabLoaderDelegateImpl::~TabLoaderDelegateImpl() { - net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); + net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this); } -void TabLoaderDelegateImpl::OnConnectionTypeChanged( +void TabLoaderDelegateImpl::OnNetworkChanged( net::NetworkChangeNotifier::ConnectionType type) { callback_->SetTabLoadingEnabled( type != net::NetworkChangeNotifier::CONNECTION_NONE); } + } // namespace // static
diff --git a/chrome/browser/ssl/mitm_software_blocking_page.cc b/chrome/browser/ssl/mitm_software_blocking_page.cc new file mode 100644 index 0000000..09f88d8 --- /dev/null +++ b/chrome/browser/ssl/mitm_software_blocking_page.cc
@@ -0,0 +1,182 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ssl/mitm_software_blocking_page.h" + +#include <utility> + +#include "base/callback_helpers.h" +#include "base/memory/ptr_util.h" +#include "chrome/browser/interstitials/chrome_controller_client.h" +#include "chrome/browser/interstitials/chrome_metrics_helper.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/renderer_preferences_util.h" +#include "chrome/browser/ssl/cert_report_helper.h" +#include "chrome/browser/ssl/ssl_cert_reporter.h" +#include "components/safe_browsing/common/safe_browsing_prefs.h" +#include "components/security_interstitials/core/metrics_helper.h" +#include "components/security_interstitials/core/mitm_software_ui.h" +#include "content/public/browser/interstitial_page.h" +#include "content/public/browser/interstitial_page_delegate.h" +#include "content/public/browser/navigation_controller.h" +#include "content/public/browser/navigation_entry.h" +#include "content/public/browser/render_process_host.h" +#include "content/public/browser/render_view_host.h" +#include "content/public/browser/ssl_status.h" +#include "content/public/browser/web_contents.h" +#include "content/public/common/renderer_preferences.h" +#include "net/base/net_errors.h" + +using content::InterstitialPageDelegate; +using content::NavigationController; +using content::NavigationEntry; + +namespace { + +const char kMetricsName[] = "mitm_software"; + +std::unique_ptr<ChromeMetricsHelper> CreateMetricsHelper( + content::WebContents* web_contents, + const GURL& request_url) { + // Set up the metrics helper for the MITMSoftwareUI. + security_interstitials::MetricsHelper::ReportDetails reporting_info; + reporting_info.metric_prefix = kMetricsName; + std::unique_ptr<ChromeMetricsHelper> metrics_helper = + base::MakeUnique<ChromeMetricsHelper>(web_contents, request_url, + reporting_info, kMetricsName); + metrics_helper.get()->StartRecordingCaptivePortalMetrics(false); + return metrics_helper; +} + +} // namespace + +// static +InterstitialPageDelegate::TypeID MITMSoftwareBlockingPage::kTypeForTesting = + &MITMSoftwareBlockingPage::kTypeForTesting; + +// Note that we always create a navigation entry with SSL errors. +// No error happening loading a sub-resource triggers an interstitial so far. +// Creating an interstitial without showing (e.g. from chrome://interstitials) +// it leaks memory, so don't create it here. +MITMSoftwareBlockingPage::MITMSoftwareBlockingPage( + content::WebContents* web_contents, + int cert_error, + const GURL& request_url, + std::unique_ptr<SSLCertReporter> ssl_cert_reporter, + const net::SSLInfo& ssl_info, + const base::Callback<void(content::CertificateRequestResultType)>& callback) + : SecurityInterstitialPage( + web_contents, + request_url, + base::MakeUnique<ChromeControllerClient>( + web_contents, + CreateMetricsHelper(web_contents, request_url))), + callback_(callback), + ssl_info_(ssl_info), + cert_report_helper_(new CertReportHelper( + std::move(ssl_cert_reporter), + web_contents, + request_url, + ssl_info, + certificate_reporting::ErrorReport::INTERSTITIAL_CLOCK, + false /* overridable */, + base::Time::Now(), + nullptr)), + mitm_software_ui_( + new security_interstitials::MITMSoftwareUI(request_url, + cert_error, + ssl_info, + controller())) {} + +MITMSoftwareBlockingPage::~MITMSoftwareBlockingPage() { + if (!callback_.is_null()) { + // Deny when the page is closed. + NotifyDenyCertificate(); + } +} + +bool MITMSoftwareBlockingPage::ShouldCreateNewNavigation() const { + return true; +} + +InterstitialPageDelegate::TypeID MITMSoftwareBlockingPage::GetTypeForTesting() + const { + return MITMSoftwareBlockingPage::kTypeForTesting; +} + +void MITMSoftwareBlockingPage::PopulateInterstitialStrings( + base::DictionaryValue* load_time_data) { + mitm_software_ui_->PopulateStringsForHTML(load_time_data); + cert_report_helper_->PopulateExtendedReportingOption(load_time_data); +} + +void MITMSoftwareBlockingPage::OverrideEntry(NavigationEntry* entry) { + entry->GetSSL() = content::SSLStatus(ssl_info_); +} + +void MITMSoftwareBlockingPage::SetSSLCertReporterForTesting( + std::unique_ptr<SSLCertReporter> ssl_cert_reporter) { + cert_report_helper_->SetSSLCertReporterForTesting( + std::move(ssl_cert_reporter)); +} + +// This handles the commands sent from the interstitial JavaScript. +void MITMSoftwareBlockingPage::CommandReceived(const std::string& command) { + if (command == "\"pageLoadComplete\"") { + // content::WaitForRenderFrameReady sends this message when the page + // load completes. Ignore it. + return; + } + + int cmd = 0; + bool retval = base::StringToInt(command, &cmd); + DCHECK(retval); + + mitm_software_ui_->HandleCommand( + static_cast<security_interstitials::SecurityInterstitialCommands>(cmd)); + + // Special handling for the reporting preference being changed. + switch (cmd) { + case security_interstitials::CMD_DO_REPORT: + safe_browsing::SetExtendedReportingPrefAndMetric( + controller()->GetPrefService(), true, + safe_browsing::SBER_OPTIN_SITE_SECURITY_INTERSTITIAL); + break; + case security_interstitials::CMD_DONT_REPORT: + safe_browsing::SetExtendedReportingPrefAndMetric( + controller()->GetPrefService(), false, + safe_browsing::SBER_OPTIN_SITE_SECURITY_INTERSTITIAL); + break; + default: + // Other commands can be ignored. + break; + } +} + +void MITMSoftwareBlockingPage::OverrideRendererPrefs( + content::RendererPreferences* prefs) { + Profile* profile = + Profile::FromBrowserContext(web_contents()->GetBrowserContext()); + renderer_preferences_util::UpdateFromSystemSettings(prefs, profile, + web_contents()); +} + +void MITMSoftwareBlockingPage::OnDontProceed() { + UpdateMetricsAfterSecurityInterstitial(); + cert_report_helper_->FinishCertCollection( + certificate_reporting::ErrorReport::USER_DID_NOT_PROCEED); + NotifyDenyCertificate(); +} + +void MITMSoftwareBlockingPage::NotifyDenyCertificate() { + // It's possible that callback_ may not exist if the user clicks "Proceed" + // followed by pressing the back button before the interstitial is hidden. + // In that case the certificate will still be treated as allowed. + if (callback_.is_null()) { + return; + } + + base::ResetAndReturn(&callback_) + .Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL); +}
diff --git a/chrome/browser/ssl/mitm_software_blocking_page.h b/chrome/browser/ssl/mitm_software_blocking_page.h new file mode 100644 index 0000000..e8e91be --- /dev/null +++ b/chrome/browser/ssl/mitm_software_blocking_page.h
@@ -0,0 +1,83 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_SSL_MITM_SOFTWARE_BLOCKING_PAGE_H_ +#define CHROME_BROWSER_SSL_MITM_SOFTWARE_BLOCKING_PAGE_H_ + +#include <memory> +#include <string> + +#include "base/callback.h" +#include "base/macros.h" +#include "chrome/browser/ssl/ssl_cert_reporter.h" +#include "components/security_interstitials/content/security_interstitial_page.h" +#include "components/ssl_errors/error_classification.h" +#include "content/public/browser/certificate_request_result_type.h" +#include "net/ssl/ssl_info.h" + +class CertReportHelper; +class GURL; + +namespace security_interstitials { +class MITMSoftwareUI; +} + +// This class is responsible for showing/hiding the interstitial page that +// occurs when an SSL error is caused by any sort of MITM software. MITM +// software includes antiviruses, firewalls, proxies or any other non-malicious +// software that intercepts and rewrites the user's connection. This class +// creates the interstitial UI using security_interstitials::MITMSoftwareUI and +// then displays it. It deletes itself when the interstitial page is closed. +class MITMSoftwareBlockingPage + : public security_interstitials::SecurityInterstitialPage { + public: + // Interstitial type, used in tests. + static InterstitialPageDelegate::TypeID kTypeForTesting; + + // If the blocking page isn't shown, the caller is responsible for cleaning + // up the blocking page. Otherwise, the interstitial takes ownership when + // shown. + MITMSoftwareBlockingPage( + content::WebContents* web_contents, + int cert_error, + const GURL& request_url, + std::unique_ptr<SSLCertReporter> ssl_cert_reporter, + const net::SSLInfo& ssl_info, + const base::Callback<void(content::CertificateRequestResultType)>& + callback); + + ~MITMSoftwareBlockingPage() override; + + // InterstitialPageDelegate method: + InterstitialPageDelegate::TypeID GetTypeForTesting() const override; + + void SetSSLCertReporterForTesting( + std::unique_ptr<SSLCertReporter> ssl_cert_reporter); + + protected: + // InterstitialPageDelegate implementation: + void CommandReceived(const std::string& command) override; + void OverrideEntry(content::NavigationEntry* entry) override; + void OverrideRendererPrefs(content::RendererPreferences* prefs) override; + void OnDontProceed() override; + + // SecurityInterstitialPage implementation: + bool ShouldCreateNewNavigation() const override; + void PopulateInterstitialStrings( + base::DictionaryValue* load_time_data) override; + + private: + void NotifyDenyCertificate(); + + base::Callback<void(content::CertificateRequestResultType)> callback_; + const net::SSLInfo ssl_info_; + + const std::unique_ptr<CertReportHelper> cert_report_helper_; + const std::unique_ptr<security_interstitials::MITMSoftwareUI> + mitm_software_ui_; + + DISALLOW_COPY_AND_ASSIGN(MITMSoftwareBlockingPage); +}; + +#endif // CHROME_BROWSER_SSL_MITM_SOFTWARE_BLOCKING_PAGE_H_
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index 28935a2..adb5896 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -136,6 +136,10 @@ #include "chrome/browser/ssl/captive_portal_blocking_page.h" #endif +#if !defined(OS_IOS) +#include "chrome/browser/ssl/mitm_software_blocking_page.h" +#endif + #if defined(USE_NSS_CERTS) #include "chrome/browser/net/nss_context.h" #include "net/cert/nss_cert_database.h" @@ -5376,6 +5380,305 @@ #endif // BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) +// The MITM software interstitial is not yet supported on iOS. +#if !defined(OS_IOS) +namespace { + +char kTestHostName[] = "example.test"; + +// Set HSTS for the test host name, so that all errors thrown on this domain +// will be nonoverridable. +void SetHSTSForHostName( + scoped_refptr<net::URLRequestContextGetter> context_getter) { + net::TransportSecurityState* state = + context_getter->GetURLRequestContext()->transport_security_state(); + const base::Time expiry = base::Time::Now() + base::TimeDelta::FromDays(1000); + EXPECT_FALSE(state->ShouldUpgradeToSSL(kTestHostName)); + state->AddHSTS(kTestHostName, expiry, false); + EXPECT_TRUE(state->ShouldUpgradeToSSL(kTestHostName)); +} + +class SSLUIMITMSoftwareTest : public CertVerifierBrowserTest { + public: + SSLUIMITMSoftwareTest() + : CertVerifierBrowserTest(), + https_server_(net::EmbeddedTestServer::TYPE_HTTPS) {} + ~SSLUIMITMSoftwareTest() override {} + + void SetUpOnMainThread() override { + CertVerifierBrowserTest::SetUpOnMainThread(); + host_resolver()->AddRule("*", "127.0.0.1"); + content::BrowserThread::PostTask( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce( + &SetHSTSForHostName, + base::RetainedRef(browser()->profile()->GetRequestContext()))); + } + + protected: + // Set up the cert verifier to return the error passed in as the cert_error + // parameter. + void SetUpCertVerifier(net::CertStatus cert_error) { + net::CertVerifyResult verify_result; + verify_result.verified_cert = + net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); + ASSERT_TRUE(verify_result.verified_cert); + + verify_result.cert_status = cert_error; + mock_cert_verifier()->AddResultForCert( + https_server()->GetCertificate().get(), verify_result, + net::MapCertStatusToNetError(cert_error)); + } + + // Sets up an SSLErrorAssistantProto that lists |https_server_|'s default + // certificate as a MITM software certificate. + void SetUpMITMSoftwareCertList() { + const std::string cert_issuer = + https_server()->GetCertificate().get()->issuer().common_name; + auto config_proto = + base::MakeUnique<chrome_browser_ssl::SSLErrorAssistantConfig>(); + chrome_browser_ssl::MITMSoftware* mitm_software = + config_proto->add_mitm_software(); + mitm_software->set_name("Matching MITM Software"); + mitm_software->set_regex(cert_issuer); + SSLErrorHandler::SetErrorAssistantProto(std::move(config_proto)); + } + + // Returns a URL which triggers an interstitial with the host name that has + // HSTS set. + GURL GetHSTSTestURL() const { + GURL::Replacements replacements; + replacements.SetHostStr(kTestHostName); + return https_server() + ->GetURL("/ssl/blank_page.html") + .ReplaceComponents(replacements); + } + + void TestMITMSoftwareInterstitial() { + base::HistogramTester histograms; + ASSERT_TRUE(https_server()->Start()); + SetUpMITMSoftwareCertList(); + + // Navigate to an unsafe page on the server. Mock out the URL host name to + // equal the one set for HSTS. + WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); + SSLInterstitialTimerObserver interstitial_timer_observer(tab); + ui_test_utils::NavigateToURL(browser(), GetHSTSTestURL()); + content::WaitForInterstitialAttach(tab); + InterstitialPage* interstitial_page = tab->GetInterstitialPage(); + ASSERT_EQ(MITMSoftwareBlockingPage::kTypeForTesting, + interstitial_page->GetDelegateForTesting()->GetTypeForTesting()); + EXPECT_FALSE(interstitial_timer_observer.timer_started()); + + // Check that the histograms for the MITM software interstitial were + // recorded. + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), + 2); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE, 0); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_MITM_SOFTWARE_INTERSTITIAL, 1); + } + + void TestNoMITMSoftwareInterstitial() { + base::HistogramTester histograms; + ASSERT_TRUE(https_server()->Start()); + SetUpMITMSoftwareCertList(); + + // Navigate to an unsafe page on the server. Mock out the URL host name to + // equal the one set for HSTS. A normal SSL interstitial should be + // displayed since the MITMSoftwareInterstitial feature is disabled. + WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); + SSLInterstitialTimerObserver interstitial_timer_observer(tab); + ui_test_utils::NavigateToURL(browser(), GetHSTSTestURL()); + content::WaitForInterstitialAttach(tab); + InterstitialPage* interstitial_page = tab->GetInterstitialPage(); + ASSERT_EQ(SSLBlockingPage::kTypeForTesting, + interstitial_page->GetDelegateForTesting()->GetTypeForTesting()); + EXPECT_TRUE(interstitial_timer_observer.timer_started()); + + // Check that the histogram for a non-overridable SSL interstitial was + // recorded. + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), + 2); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_OVERRIDABLE, 0); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_MITM_SOFTWARE_INTERSTITIAL, 0); + } + + // Returns the https server. Guaranteed to be non-NULL. + const net::EmbeddedTestServer* https_server() const { return &https_server_; } + net::EmbeddedTestServer* https_server() { return &https_server_; } + + private: + net::EmbeddedTestServer https_server_; + + DISALLOW_COPY_AND_ASSIGN(SSLUIMITMSoftwareTest); +}; + +} // namespace + +// Tests that the MITM software interstitial is not displayed when the feature +// is disabled by Finch. +IN_PROC_BROWSER_TEST_F(SSLUIMITMSoftwareTest, DisabledWithFinch) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitFromCommandLine( + std::string() /* enabled */, "MITMSoftwareInterstitial" /* disabled */); + + SetUpCertVerifier(net::CERT_STATUS_AUTHORITY_INVALID); + TestNoMITMSoftwareInterstitial(); +} + +// Tests that the MITM software interstitial is displayed when the feature is +// enabled by Finch. +IN_PROC_BROWSER_TEST_F(SSLUIMITMSoftwareTest, EnabledWithFinch) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitFromCommandLine( + "MITMSoftwareInterstitial" /* enabled */, std::string() /* disabled */); + + SetUpCertVerifier(net::CERT_STATUS_AUTHORITY_INVALID); + TestMITMSoftwareInterstitial(); +} + +// Tests that if a certificate issuer's common name does not match any of the +// MITM software regexes served by the SSLErrorAssistantProto the MITM software +// interstitial will not be displayed. +IN_PROC_BROWSER_TEST_F(SSLUIMITMSoftwareTest, + NonMatchingCertificate_NoMITMSoftwareInterstitial) { + base::HistogramTester histograms; + + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitFromCommandLine( + "MITMSoftwareInterstitial" /* enabled */, std::string() /* disabled */); + + SetUpCertVerifier(net::CERT_STATUS_AUTHORITY_INVALID); + ASSERT_TRUE(https_server()->Start()); + + // Set up an error assistant proto with a list of MITM software regexed that + // the certificate issued by our server won't match. + auto config_proto = + base::MakeUnique<chrome_browser_ssl::SSLErrorAssistantConfig>(); + chrome_browser_ssl::MITMSoftware* mitm_software = + config_proto->add_mitm_software(); + mitm_software->set_name("Non-Matching MITM Software"); + mitm_software->set_regex("pattern-that-does-not-match-anything"); + SSLErrorHandler::SetErrorAssistantProto(std::move(config_proto)); + + // Navigate to an unsafe page on the server. Mock out the URL host name to + // equal the one set for HSTS. + WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); + SSLInterstitialTimerObserver interstitial_timer_observer(tab); + ui_test_utils::NavigateToURL(browser(), GetHSTSTestURL()); + content::WaitForInterstitialAttach(tab); + InterstitialPage* interstitial_page = tab->GetInterstitialPage(); + ASSERT_EQ(SSLBlockingPage::kTypeForTesting, + interstitial_page->GetDelegateForTesting()->GetTypeForTesting()); + EXPECT_TRUE(interstitial_timer_observer.timer_started()); + + // Check that the histograms for the MITM software interstitial were + // recorded. + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 2); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE, 1); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_MITM_SOFTWARE_INTERSTITIAL, + 0); +} + +// Tests that if there is more than one error on the certificate the MITM +// software interstitial will not be displayed. +IN_PROC_BROWSER_TEST_F(SSLUIMITMSoftwareTest, + TwoCertErrors_NoMITMSoftwareInterstitial) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitFromCommandLine( + "MITMSoftwareInterstitial" /* enabled */, std::string() /* disabled */); + + SetUpCertVerifier(net::CERT_STATUS_AUTHORITY_INVALID | + net::CERT_STATUS_COMMON_NAME_INVALID); + TestNoMITMSoftwareInterstitial(); +} + +// Tests that a certificate error other than |CERT_STATUS_AUTHORITY_INVALID| +// will not trigger the MITM software interstitial. +IN_PROC_BROWSER_TEST_F(SSLUIMITMSoftwareTest, + WrongCertError_NoMITMSoftwareInterstitial) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitFromCommandLine( + "MITMSoftwareInterstitial" /* enabled */, std::string() /* disabled */); + + SetUpCertVerifier(net::CERT_STATUS_COMMON_NAME_INVALID); + TestNoMITMSoftwareInterstitial(); +} + +// Tests that if the error on the certificate served is overridable the MITM +// software interstitial will not be displayed. +IN_PROC_BROWSER_TEST_F(SSLUIMITMSoftwareTest, + OverridableError_NoMITMSoftwareInterstitial) { + base::HistogramTester histograms; + + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitFromCommandLine( + "MITMSoftwareInterstitial" /* enabled */, std::string() /* disabled */); + SetUpCertVerifier(net::CERT_STATUS_AUTHORITY_INVALID); + + ASSERT_TRUE(https_server()->Start()); + SetUpMITMSoftwareCertList(); + + // Navigate to an unsafe page to trigger an interstitial, but don't replace + // the host name with the one set for HSTS. + WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); + SSLInterstitialTimerObserver interstitial_timer_observer(tab); + ui_test_utils::NavigateToURL(browser(), + https_server()->GetURL("/ssl/blank_page.html")); + content::WaitForInterstitialAttach(tab); + InterstitialPage* interstitial_page = tab->GetInterstitialPage(); + ASSERT_EQ(SSLBlockingPage::kTypeForTesting, + interstitial_page->GetDelegateForTesting()->GetTypeForTesting()); + EXPECT_TRUE(interstitial_timer_observer.timer_started()); + + // Check that the histogram for an overridable SSL interstitial was + // recorded. + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 2); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_OVERRIDABLE, 1); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_MITM_SOFTWARE_INTERSTITIAL, + 0); +} + +#else + +// Tests that the MITM software interstitial does not render on iOS, where it +// is disabled by build. +IN_PROC_BROWSER_TEST_F(SSLUIMITMSoftwareTest, + DisabledByBuild_NoMITMSoftwareInterstitial) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitFromCommandLine( + "MITMSoftwareInterstitial" /* enabled */, std::string() /* disabled */); + + TestNoMITMSoftwareInterstitial(); +} + +#endif // #if !defined(OS_IOS) + class SuperfishSSLUITest : public CertVerifierBrowserTest { public: SuperfishSSLUITest()
diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc index 6952d1d..c46ec86 100644 --- a/chrome/browser/ssl/ssl_error_handler.cc +++ b/chrome/browser/ssl/ssl_error_handler.cc
@@ -48,6 +48,10 @@ #include "chrome/browser/ssl/captive_portal_blocking_page.h" #endif +#if !defined(OS_IOS) +#include "chrome/browser/ssl/mitm_software_blocking_page.h" +#endif + namespace { #if !defined(OS_IOS) @@ -531,16 +535,10 @@ void SSLErrorHandlerDelegateImpl::ShowMITMSoftwareInterstitial() { #if !defined(OS_IOS) - // TODO(sperigo): Update this code to render the MITM software blocking - // page. For the first MITM software interstitial CL, I am not checking - // in any of the UI code. Therefore ShowMITMSoftwareInterstitial() - // currently renders the generic SSL interstitial. - (SSLBlockingPage::Create( - web_contents_, cert_error_, ssl_info_, request_url_, options_mask_, - base::Time::NowFromSystemTime(), std::move(ssl_cert_reporter_), - base::FeatureList::IsEnabled(kSuperfishInterstitial) && - IsSuperfish(ssl_info_.cert), - callback_)) + // Show MITM software blocking page. The interstitial owns the blocking page. + (new MITMSoftwareBlockingPage(web_contents_, cert_error_, request_url_, + std::move(ssl_cert_reporter_), ssl_info_, + callback_)) ->Show(); #else NOTREACHED();
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 2c7ae1f4..90ec380 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -2257,8 +2257,10 @@ "crypto_module_delegate_nss.h", "crypto_module_password_dialog_nss.cc", "crypto_module_password_dialog_nss.h", - "webui/settings/certificates_handler.cc", - "webui/settings/certificates_handler.h", + "webui/certificate_manager_localized_strings_provider.cc", + "webui/certificate_manager_localized_strings_provider.h", + "webui/certificates_handler.cc", + "webui/certificates_handler.h", ] if (is_chromeos) { sources += [
diff --git a/chrome/browser/ui/android/infobars/reader_mode_infobar.cc b/chrome/browser/ui/android/infobars/reader_mode_infobar.cc index c73aef3..e1536bd 100644 --- a/chrome/browser/ui/android/infobars/reader_mode_infobar.cc +++ b/chrome/browser/ui/android/infobars/reader_mode_infobar.cc
@@ -51,6 +51,9 @@ const JavaParamRef<jobject>& obj) { content::WebContents* web_contents = InfoBarService::WebContentsFromInfoBar(this); + if (!web_contents) + return nullptr; + TabAndroid* tab_android = TabAndroid::FromWebContents(web_contents); return tab_android ? tab_android->GetJavaObject() : nullptr; }
diff --git a/chrome/browser/ui/app_list/search/answer_card/answer_card_contents.h b/chrome/browser/ui/app_list/search/answer_card/answer_card_contents.h index 2e855a54..618d447 100644 --- a/chrome/browser/ui/app_list/search/answer_card/answer_card_contents.h +++ b/chrome/browser/ui/app_list/search/answer_card/answer_card_contents.h
@@ -13,10 +13,6 @@ class AnswerCardResult; } -namespace gfx { -class Size; -} - namespace views { class View; } @@ -34,13 +30,14 @@ // Events that the delegate processes. They have same meaning as same-named // events in WebContentsDelegate and WebContentsObserver, however, // unnecessary parameters are omitted. - virtual void UpdatePreferredSize(const gfx::Size& pref_size) = 0; - virtual void DidFinishNavigation(const GURL& url, + virtual void UpdatePreferredSize(const AnswerCardContents* source) = 0; + virtual void DidFinishNavigation(const AnswerCardContents* source, + const GURL& url, bool has_error, bool has_answer_card, const std::string& result_title, const std::string& issued_query) = 0; - virtual void DidStopLoading() = 0; + virtual void DidStopLoading(const AnswerCardContents* source) = 0; private: DISALLOW_COPY_AND_ASSIGN(Delegate); @@ -51,8 +48,6 @@ // Loads contents from |url|. virtual void LoadURL(const GURL& url) = 0; - // Returns whether loading is in progress. - virtual bool IsLoading() const = 0; // Returns the view associated with the contents. virtual views::View* GetView() = 0;
diff --git a/chrome/browser/ui/app_list/search/answer_card/answer_card_result_unittest.cc b/chrome/browser/ui/app_list/search/answer_card/answer_card_result_unittest.cc index 2ed07c3..dadcb73 100644 --- a/chrome/browser/ui/app_list/search/answer_card/answer_card_result_unittest.cc +++ b/chrome/browser/ui/app_list/search/answer_card/answer_card_result_unittest.cc
@@ -31,10 +31,6 @@ // AnswerCardContents overrides: void LoadURL(const GURL& url) override { NOTREACHED(); } - bool IsLoading() const override { - NOTREACHED(); - return true; - } views::View* GetView() override { return &view_; } private:
diff --git a/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.cc b/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.cc index 04e3804..33d2a252 100644 --- a/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.cc +++ b/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.cc
@@ -41,47 +41,55 @@ } // namespace +AnswerCardSearchProvider::NavigationContext::NavigationContext() {} + +AnswerCardSearchProvider::NavigationContext::~NavigationContext() {} + +void AnswerCardSearchProvider::NavigationContext::StartServerRequest( + const GURL& url) { + contents->LoadURL(url); + state = RequestState::NO_RESULT; +} + +void AnswerCardSearchProvider::NavigationContext::Clear() { + result_url.clear(); + result_title.clear(); + state = RequestState::NO_RESULT; + // We are not clearing |preferred_size| since the |contents| remains + // unchanged, and |preferred_size| always corresponds to the contents's size. +} + AnswerCardSearchProvider::AnswerCardSearchProvider( Profile* profile, app_list::AppListModel* model, AppListControllerDelegate* list_controller, - std::unique_ptr<AnswerCardContents> contents) + std::unique_ptr<AnswerCardContents> contents0, + std::unique_ptr<AnswerCardContents> contents1) : profile_(profile), model_(model), list_controller_(list_controller), - contents_(std::move(contents)), answer_server_url_(features::AnswerServerUrl()), template_url_service_(TemplateURLServiceFactory::GetForProfile(profile)) { - contents_->SetDelegate(this); + navigation_contexts_[0].contents = std::move(contents0); + navigation_contexts_[1].contents = std::move(contents1); + navigation_contexts_[0].contents->SetDelegate(this); + navigation_contexts_[1].contents->SetDelegate(this); } AnswerCardSearchProvider::~AnswerCardSearchProvider() { - RecordReceivedAnswerFinalResult(); } void AnswerCardSearchProvider::Start(bool is_voice_query, const base::string16& query) { - RecordReceivedAnswerFinalResult(); // Reset the state. - received_answer_ = false; - OnResultAvailable(false); current_request_url_ = GURL(); - result_url_.clear(); - result_title_.clear(); server_request_start_time_ = answer_loaded_time_ = base::TimeTicks(); - if (is_voice_query) { - // No need to send a server request and show a card because launcher - // automatically closes upon voice queries. + if (query.empty() || is_voice_query || !model_->search_engine_is_google()) { + DeleteCurrentResult(); return; } - if (!model_->search_engine_is_google()) - return; - - if (query.empty()) - return; - // Start a request to the answer server. // Lifetime of |prefixed_query| should be longer than the one of @@ -92,15 +100,20 @@ GURL::Replacements replacements; replacements.SetQueryStr(prefixed_query); current_request_url_ = answer_server_url_.ReplaceComponents(replacements); - contents_->LoadURL(current_request_url_); + GetNavigationContextForLoading().StartServerRequest(current_request_url_); server_request_start_time_ = base::TimeTicks::Now(); } -void AnswerCardSearchProvider::UpdatePreferredSize(const gfx::Size& pref_size) { - preferred_size_ = pref_size; - OnResultAvailable(received_answer_ && IsCardSizeOk() && - !contents_->IsLoading()); +void AnswerCardSearchProvider::UpdatePreferredSize( + const AnswerCardContents* source) { + if (source != GetCurrentNavigationContext().contents.get()) + return; + + // Contents' size changed for the current card. Updating the result to cause + // relayout. + UpdateResult(); + if (!answer_loaded_time_.is_null()) { UMA_HISTOGRAM_TIMES("SearchAnswer.ResizeAfterLoadTime", base::TimeTicks::Now() - answer_loaded_time_); @@ -108,11 +121,15 @@ } void AnswerCardSearchProvider::DidFinishNavigation( + const AnswerCardContents* source, const GURL& url, bool has_error, bool has_answer_card, const std::string& result_title, const std::string& issued_query) { + NavigationContext& context_for_loading = GetNavigationContextForLoading(); + DCHECK_EQ(source, context_for_loading.contents.get()); + if (url != current_request_url_) { // TODO(vadimt): Remove this and similar logging once testing is complete if // we think this is not useful after release or happens too frequently. @@ -126,84 +143,84 @@ if (has_error) { RecordRequestResult( SearchAnswerRequestResult::REQUEST_RESULT_REQUEST_FAILED); + // Loading new card has failed. This invalidates the currently shown result. + DeleteCurrentResult(); return; } if (!features::IsAnswerCardDarkRunEnabled()) { if (!has_answer_card) { RecordRequestResult(SearchAnswerRequestResult::REQUEST_RESULT_NO_ANSWER); + // No answer card in the server response. This invalidates the currently + // shown result. + DeleteCurrentResult(); return; } DCHECK(!result_title.empty()); DCHECK(!issued_query.empty()); - result_title_ = result_title; - result_url_ = GetResultUrl(base::UTF8ToUTF16(issued_query)); + context_for_loading.result_title = result_title; + context_for_loading.result_url = + GetResultUrl(base::UTF8ToUTF16(issued_query)); + RecordRequestResult( + SearchAnswerRequestResult::REQUEST_RESULT_RECEIVED_ANSWER); } else { // In the dark run mode, every other "server response" contains a card. dark_run_received_answer_ = !dark_run_received_answer_; if (!dark_run_received_answer_) return; // SearchResult requires a non-empty id. This "url" will never be opened. - result_url_ = "https://www.google.com/?q=something"; + context_for_loading.result_url = "https://www.google.com/?q=something"; } - received_answer_ = true; + context_for_loading.state = RequestState::HAVE_RESULT_LOADING; UMA_HISTOGRAM_TIMES("SearchAnswer.NavigationTime", base::TimeTicks::Now() - server_request_start_time_); } -void AnswerCardSearchProvider::DidStopLoading() { - if (!received_answer_) - return; +void AnswerCardSearchProvider::DidStopLoading( + const AnswerCardContents* source) { + NavigationContext& context_for_loading = GetNavigationContextForLoading(); + DCHECK_EQ(source, context_for_loading.contents.get()); - if (IsCardSizeOk()) - OnResultAvailable(true); + if (context_for_loading.state != RequestState::HAVE_RESULT_LOADING) { + // This stop-loading event is either for a navigation that was intercepted + // by another navigation, or for a failed navigation. In both cases, there + // is nothing we need to do about it. + return; + } + + context_for_loading.state = RequestState::HAVE_RESULT_LOADED; + + // Prepare for loading card into the other contents. Loading will start when + // the user modifies the query string. + GetCurrentNavigationContext().Clear(); + current_navigation_context_ = 1 - current_navigation_context_; + + // Show the result. + UpdateResult(); + answer_loaded_time_ = base::TimeTicks::Now(); UMA_HISTOGRAM_TIMES("SearchAnswer.LoadingTime", answer_loaded_time_ - server_request_start_time_); base::RecordAction(base::UserMetricsAction("SearchAnswer_StoppedLoading")); } -bool AnswerCardSearchProvider::IsCardSizeOk() const { - if (features::IsAnswerCardDarkRunEnabled()) - return true; - - if (preferred_size_.width() <= features::AnswerCardMaxWidth() && - preferred_size_.height() <= features::AnswerCardMaxHeight()) { - return true; - } - - LOG(ERROR) << "Card is too large: width=" << preferred_size_.width() - << ", height=" << preferred_size_.height(); - return false; -} - -void AnswerCardSearchProvider::RecordReceivedAnswerFinalResult() { - // Recording whether a server response with an answer contains a card of a - // fitting size, or a too large one. Cannot do this in DidStopLoading() or - // UpdatePreferredSize() because this may be followed by a resizing with - // different dimensions, so this method gets called when card's life ends. - if (!received_answer_) - return; - - RecordRequestResult( - IsCardSizeOk() ? SearchAnswerRequestResult::REQUEST_RESULT_RECEIVED_ANSWER - : SearchAnswerRequestResult:: - REQUEST_RESULT_RECEIVED_ANSWER_TOO_LARGE); -} - -void AnswerCardSearchProvider::OnResultAvailable(bool is_available) { +void AnswerCardSearchProvider::UpdateResult() { SearchProvider::Results results; - if (is_available) { + + const NavigationContext& current_context = GetCurrentNavigationContext(); + if (current_context.state == RequestState::HAVE_RESULT_LOADED) { results.reserve(1); const GURL stripped_result_url = AutocompleteMatch::GURLToStrippedGURL( - GURL(result_url_), AutocompleteInput(), template_url_service_, - base::string16() /* keyword */); + GURL(current_context.result_url), AutocompleteInput(), + template_url_service_, base::string16() /* keyword */); results.emplace_back(base::MakeUnique<AnswerCardResult>( - profile_, list_controller_, result_url_, stripped_result_url.spec(), - base::UTF8ToUTF16(result_title_), contents_.get())); + profile_, list_controller_, current_context.result_url, + stripped_result_url.spec(), + base::UTF8ToUTF16(current_context.result_title), + current_context.contents.get())); } SwapResults(&results); } @@ -216,4 +233,19 @@ template_url_service_->search_terms_data()); } +void AnswerCardSearchProvider::DeleteCurrentResult() { + GetCurrentNavigationContext().Clear(); + UpdateResult(); +} + +AnswerCardSearchProvider::NavigationContext& +AnswerCardSearchProvider::GetCurrentNavigationContext() { + return navigation_contexts_[current_navigation_context_]; +} + +AnswerCardSearchProvider::NavigationContext& +AnswerCardSearchProvider::GetNavigationContextForLoading() { + return navigation_contexts_[1 - current_navigation_context_]; +} + } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.h b/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.h index 75b538e9..9a626cfa 100644 --- a/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.h +++ b/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.h
@@ -11,7 +11,6 @@ #include "base/time/time.h" #include "chrome/browser/ui/app_list/search/answer_card/answer_card_contents.h" #include "ui/app_list/search_provider.h" -#include "ui/gfx/geometry/size.h" #include "url/gurl.h" class AppListControllerDelegate; @@ -31,7 +30,8 @@ AnswerCardSearchProvider(Profile* profile, app_list::AppListModel* model, AppListControllerDelegate* list_controller, - std::unique_ptr<AnswerCardContents> contents); + std::unique_ptr<AnswerCardContents> contents0, + std::unique_ptr<AnswerCardContents> contents1); ~AnswerCardSearchProvider() override; @@ -40,20 +40,54 @@ void Stop() override {} // AnswerCardContents::Delegate overrides: - void UpdatePreferredSize(const gfx::Size& pref_size) override; - void DidFinishNavigation(const GURL& url, + void UpdatePreferredSize(const AnswerCardContents* source) override; + void DidFinishNavigation(const AnswerCardContents* source, + const GURL& url, bool has_error, bool has_answer_card, const std::string& result_title, const std::string& issued_query) override; - void DidStopLoading() override; + void DidStopLoading(const AnswerCardContents* source) override; private: - bool IsCardSizeOk() const; - void RecordReceivedAnswerFinalResult(); - void OnResultAvailable(bool is_available); + enum class RequestState { + NO_RESULT, + HAVE_RESULT_LOADING, + HAVE_RESULT_LOADED + }; + + // State of navigation for a single AnswerCardContents. There are 2 instances + // of AnswerCardContents: one is used to show the current answer, and the + // other for loading an answer for the next query. Once the answer has been + // loaded, the roles of contents instances get swapped. + struct NavigationContext { + NavigationContext(); + ~NavigationContext(); + + void StartServerRequest(const GURL& url); + void Clear(); + + // The source of answer card contents. + std::unique_ptr<AnswerCardContents> contents; + + // State of a server request. + RequestState state = RequestState::NO_RESULT; + + // Url to open when the user clicks at the result. + std::string result_url; + + // Title of the result. + std::string result_title; + + DISALLOW_COPY_AND_ASSIGN(NavigationContext); + }; + + void UpdateResult(); // Returns Url to open when the user clicks at the result for |query|. std::string GetResultUrl(const base::string16& query) const; + void DeleteCurrentResult(); + NavigationContext& GetCurrentNavigationContext(); + NavigationContext& GetNavigationContextForLoading(); // Unowned pointer to the associated profile. Profile* const profile_; @@ -64,12 +98,15 @@ // Unowned pointer to app list controller. AppListControllerDelegate* const list_controller_; - // The source of answer card contents. - const std::unique_ptr<AnswerCardContents> contents_; + // Index of the navigation contents corresponding to the current result. 1 - + // |current_navigation_context_| will be used for loading the next card, or is + // already used loading a new card. This pointer switches to the other + // contents after the card gets successfully loaded. + int current_navigation_context_ = 0; - // Whether have received a server response for the current query string, and - // the response contains an answer. - bool received_answer_ = false; + // States of card navigation. one is used to show the current answer, and + // another for loading an answer for the next query. + NavigationContext navigation_contexts_[2]; // If valid, URL of the answer server. Otherwise, search answers are disabled. GURL answer_server_url_; @@ -87,15 +124,6 @@ // response contains an answer. bool dark_run_received_answer_ = false; - // Url to open when the user clicks at the result. - std::string result_url_; - - // Title of the result. - std::string result_title_; - - // Current preferred size of the contents. - gfx::Size preferred_size_; - // Unowned pointer to template URL service. TemplateURLService* const template_url_service_;
diff --git a/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider_unittest.cc b/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider_unittest.cc index 325b52d8..f07eda4 100644 --- a/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider_unittest.cc +++ b/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider_unittest.cc
@@ -39,12 +39,16 @@ constexpr char kSomeParam[] = "&some_param=some_value"; constexpr char kCatQuery[] = "cat"; constexpr char kDogQuery[] = "dog"; +constexpr char kSharkQuery[] = "shark"; constexpr char kCatCardId[] = "https://www.google.com/search?q=cat&sourceid=chrome&ie=UTF-8"; constexpr char kDogCardId[] = "https://www.google.com/search?q=dog&sourceid=chrome&ie=UTF-8"; +constexpr char kSharkCardId[] = + "https://www.google.com/search?q=shark&sourceid=chrome&ie=UTF-8"; constexpr char kCatCardTitle[] = "Cat is a furry beast."; constexpr char kDogCardTitle[] = "Dog is a friendly beast."; +constexpr char kSharkCardTitle[] = "Shark is a scary beast."; GURL GetSearchUrl(const std::string& query) { return GURL( @@ -57,18 +61,12 @@ // AnswerCardContents overrides: MOCK_METHOD1(LoadURL, void(const GURL& url)); - MOCK_CONST_METHOD0(IsLoading, bool()); MOCK_METHOD0(GetView, views::View*()); private: DISALLOW_COPY_AND_ASSIGN(MockAnswerCardContents); }; -gfx::Size GetMaxValidCardSize() { - return gfx::Size(features::AnswerCardMaxWidth(), - features::AnswerCardMaxHeight()); -} - std::unique_ptr<KeyedService> CreateTemplateURLService( content::BrowserContext* context) { return base::MakeUnique<TemplateURLService>(nullptr, 0); @@ -80,34 +78,54 @@ public: AnswerCardSearchProviderTest() : field_trial_list_(nullptr) {} - void TestDidFinishNavigation(bool has_error, + void TestDidFinishNavigation(int contents_number, + bool has_error, bool has_answer_card, const std::string& title, const std::string& issued_query, std::size_t expected_result_count) { - EXPECT_CALL(*contents(), LoadURL(GetSearchUrl(kCatQuery))); + MockAnswerCardContents* const contents = + contents_number == 0 ? contents0_ : contents1_; + EXPECT_CALL(*contents, LoadURL(GetSearchUrl(kCatQuery))); provider()->Start(false, base::UTF8ToUTF16(kCatQuery)); - provider()->DidFinishNavigation(GetSearchUrl(kCatQuery), has_error, - has_answer_card, title, issued_query); + provider()->DidFinishNavigation(contents, GetSearchUrl(kCatQuery), + has_error, has_answer_card, title, + issued_query); - provider()->DidStopLoading(); - provider()->UpdatePreferredSize(GetMaxValidCardSize()); + provider()->DidStopLoading(contents); EXPECT_EQ(expected_result_count, results().size()); - testing::Mock::VerifyAndClearExpectations(contents()); + testing::Mock::VerifyAndClearExpectations(contents); + } + + void VerifyResult(const std::string& message, + const std::string& id, + views::View* view, + const std::string& title) { + SCOPED_TRACE(message); + + EXPECT_EQ(1UL, results().size()); + SearchResult* result = results()[0].get(); + EXPECT_EQ(SearchResult::DISPLAY_CARD, result->display_type()); + EXPECT_EQ(id, result->id()); + EXPECT_EQ(1, result->relevance()); + EXPECT_EQ(view, result->view()); + EXPECT_EQ(base::UTF8ToUTF16(title), result->title()); } AppListModel* model() const { return model_.get(); } const SearchProvider::Results& results() { return provider()->results(); } - MockAnswerCardContents* contents() const { return contents_; } + MockAnswerCardContents* contents0() const { return contents0_; } + MockAnswerCardContents* contents1() const { return contents1_; } AnswerCardSearchProvider* provider() const { return provider_.get(); } - views::View* view() { return &view_; } + views::View* view0() { return &view0_; } + views::View* view1() { return &view1_; } // AppListTestBase overrides: void SetUp() override { @@ -132,176 +150,283 @@ base::FeatureList::OVERRIDE_ENABLE_FEATURE, trial.get()); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); - contents_ = new MockAnswerCardContents; - std::unique_ptr<AnswerCardContents> contents(contents_); + contents0_ = new MockAnswerCardContents; + contents1_ = new MockAnswerCardContents; + std::unique_ptr<AnswerCardContents> contents0(contents0_); + std::unique_ptr<AnswerCardContents> contents1(contents1_); TemplateURLServiceFactory::GetInstance()->SetTestingFactory( profile_.get(), CreateTemplateURLService); // Provider will own the MockAnswerCardContents instance. provider_ = base::MakeUnique<AnswerCardSearchProvider>( - profile_.get(), model_.get(), nullptr, std::move(contents)); + profile_.get(), model_.get(), nullptr, std::move(contents0), + std::move(contents1)); - ON_CALL(*contents_, GetView()).WillByDefault(Return(view())); + ON_CALL(*contents0_, GetView()).WillByDefault(Return(view0())); + ON_CALL(*contents1_, GetView()).WillByDefault(Return(view1())); } private: std::unique_ptr<app_list::AppListModel> model_; std::unique_ptr<AnswerCardSearchProvider> provider_; std::unique_ptr<::test::TestAppListControllerDelegate> controller_; - MockAnswerCardContents* contents_ = nullptr; // Unowned. + MockAnswerCardContents* contents0_ = nullptr; // Unowned. + MockAnswerCardContents* contents1_ = nullptr; // Unowned. base::FieldTrialList field_trial_list_; base::test::ScopedFeatureList scoped_feature_list_; - views::View view_; + views::View view0_; + views::View view1_; DISALLOW_COPY_AND_ASSIGN(AnswerCardSearchProviderTest); }; // Basic event sequence. TEST_F(AnswerCardSearchProviderTest, Basic) { - EXPECT_CALL(*contents(), LoadURL(GetSearchUrl(kCatQuery))); + EXPECT_CALL(*contents1(), LoadURL(GetSearchUrl(kCatQuery))); provider()->Start(false, base::UTF8ToUTF16(kCatQuery)); - provider()->DidFinishNavigation(GetSearchUrl(kCatQuery), false, true, - kCatCardTitle, kCatQuery); - provider()->DidStopLoading(); - provider()->UpdatePreferredSize(GetMaxValidCardSize()); + provider()->DidFinishNavigation(contents1(), GetSearchUrl(kCatQuery), false, + true, kCatCardTitle, kCatQuery); + provider()->DidStopLoading(contents1()); - EXPECT_EQ(1UL, results().size()); - SearchResult* result = results()[0].get(); - EXPECT_EQ(SearchResult::DISPLAY_CARD, result->display_type()); - EXPECT_EQ(kCatCardId, result->id()); - EXPECT_EQ(1, result->relevance()); - EXPECT_EQ(view(), result->view()); - EXPECT_EQ(base::UTF8ToUTF16(kCatCardTitle), result->title()); + VerifyResult("Basic Result", kCatCardId, view1(), kCatCardTitle); + + // Now an empty query. + EXPECT_CALL(*contents0(), LoadURL(_)).Times(0); + provider()->Start(false, base::UTF8ToUTF16("")); + EXPECT_EQ(0UL, results().size()); } // Voice queries are ignored. TEST_F(AnswerCardSearchProviderTest, VoiceQuery) { - EXPECT_CALL(*contents(), LoadURL(_)).Times(0); + EXPECT_CALL(*contents1(), LoadURL(_)).Times(0); provider()->Start(true, base::UTF8ToUTF16(kCatQuery)); } // Queries to non-Google search engines are ignored. TEST_F(AnswerCardSearchProviderTest, NotGoogle) { model()->SetSearchEngineIsGoogle(false); - EXPECT_CALL(*contents(), LoadURL(_)).Times(0); + EXPECT_CALL(*contents1(), LoadURL(_)).Times(0); provider()->Start(false, base::UTF8ToUTF16(kCatQuery)); } -// Zero-query is ignored. -TEST_F(AnswerCardSearchProviderTest, EmptyQuery) { - EXPECT_CALL(*contents(), LoadURL(_)).Times(0); - provider()->Start(false, base::UTF8ToUTF16("")); -} - -// Two queries, the second produces a card of exactly same size, so -// UpdatePreferredSize() doesn't come. The second query should still produce a -// result. -TEST_F(AnswerCardSearchProviderTest, TwoResultsSameSize) { - EXPECT_CALL(*contents(), LoadURL(GetSearchUrl(kCatQuery))); +// Three queries in a row. +TEST_F(AnswerCardSearchProviderTest, ThreeQueries) { + // 1. Fetch for cat. + EXPECT_CALL(*contents1(), LoadURL(GetSearchUrl(kCatQuery))); provider()->Start(false, base::UTF8ToUTF16(kCatQuery)); - provider()->DidFinishNavigation(GetSearchUrl(kCatQuery), false, true, - kCatCardTitle, kCatQuery); - provider()->DidStopLoading(); - provider()->UpdatePreferredSize(GetMaxValidCardSize()); + provider()->DidFinishNavigation(contents1(), GetSearchUrl(kCatQuery), false, + true, kCatCardTitle, kCatQuery); + provider()->DidStopLoading(contents1()); - EXPECT_EQ(1UL, results().size()); - SearchResult* result = results()[0].get(); - EXPECT_EQ(SearchResult::DISPLAY_CARD, result->display_type()); - EXPECT_EQ(kCatCardId, result->id()); - EXPECT_EQ(1, result->relevance()); - EXPECT_EQ(view(), result->view()); - EXPECT_EQ(base::UTF8ToUTF16(kCatCardTitle), result->title()); + VerifyResult("Cat Result 1", kCatCardId, view1(), kCatCardTitle); - EXPECT_CALL(*contents(), LoadURL(GetSearchUrl(kDogQuery))); + // 2. Fetch for dog. + // Starting another (dog) search doesn't dismiss the cat card. + EXPECT_CALL(*contents0(), LoadURL(GetSearchUrl(kDogQuery))); provider()->Start(false, base::UTF8ToUTF16(kDogQuery)); + + VerifyResult("Cat Result 2", kCatCardId, view1(), kCatCardTitle); + + provider()->DidFinishNavigation(contents0(), GetSearchUrl(kDogQuery), false, + true, kDogCardTitle, kDogQuery); + + // The cat still stays. + VerifyResult("Cat Result 3", kCatCardId, view1(), kCatCardTitle); + + provider()->DidStopLoading(contents0()); + + // Once the dog finishes loading, it replaces the cat. + VerifyResult("Dog Result 1", kDogCardId, view0(), kDogCardTitle); + + // 3. Fetch for shark. + // The third query will use contents1/view1 again. + EXPECT_CALL(*contents1(), LoadURL(GetSearchUrl(kSharkQuery))); + provider()->Start(false, base::UTF8ToUTF16(kSharkQuery)); + + VerifyResult("Dog Result 2", kDogCardId, view0(), kDogCardTitle); + + provider()->DidFinishNavigation(contents1(), GetSearchUrl(kSharkQuery), false, + true, kSharkCardTitle, kSharkQuery); + + VerifyResult("Dog Result 3", kDogCardId, view0(), kDogCardTitle); + + provider()->DidStopLoading(contents1()); + + VerifyResult("Shark Result", kSharkCardId, view1(), kSharkCardTitle); +} + +// Three queries in a row, second one fails due to an error. +TEST_F(AnswerCardSearchProviderTest, ThreeQueriesSecondErrors) { + // 1. Fetch for cat. + EXPECT_CALL(*contents1(), LoadURL(GetSearchUrl(kCatQuery))); + provider()->Start(false, base::UTF8ToUTF16(kCatQuery)); + provider()->DidFinishNavigation(contents1(), GetSearchUrl(kCatQuery), false, + true, kCatCardTitle, kCatQuery); + provider()->DidStopLoading(contents1()); + + VerifyResult("Cat Result 1", kCatCardId, view1(), kCatCardTitle); + + // 2. Fetch for dog. This will fail with an error. + EXPECT_CALL(*contents0(), LoadURL(GetSearchUrl(kDogQuery))); + provider()->Start(false, base::UTF8ToUTF16(kDogQuery)); + + VerifyResult("Cat Result 2", kCatCardId, view1(), kCatCardTitle); + + provider()->DidFinishNavigation(contents0(), GetSearchUrl(kDogQuery), true, + false, "", ""); + EXPECT_EQ(0UL, results().size()); - provider()->DidFinishNavigation(GetSearchUrl(kDogQuery), false, true, - kDogCardTitle, kDogQuery); - provider()->DidStopLoading(); - // No UpdatePreferredSize(). + provider()->DidStopLoading(contents0()); - EXPECT_EQ(1UL, results().size()); - result = results()[0].get(); - EXPECT_EQ(SearchResult::DISPLAY_CARD, result->display_type()); - EXPECT_EQ(kDogCardId, result->id()); - EXPECT_EQ(1, result->relevance()); - EXPECT_EQ(view(), result->view()); - EXPECT_EQ(base::UTF8ToUTF16(kDogCardTitle), result->title()); + EXPECT_EQ(0UL, results().size()); + + // 3. Fetch for shark. + EXPECT_CALL(*contents0(), LoadURL(GetSearchUrl(kSharkQuery))); + provider()->Start(false, base::UTF8ToUTF16(kSharkQuery)); + + EXPECT_EQ(0UL, results().size()); + + provider()->DidFinishNavigation(contents0(), GetSearchUrl(kSharkQuery), false, + true, kSharkCardTitle, kSharkQuery); + + EXPECT_EQ(0UL, results().size()); + + provider()->DidStopLoading(contents0()); + + VerifyResult("Shark Result", kSharkCardId, view0(), kSharkCardTitle); +} + +// Three queries in a row, second one fails because the server responds with no +// card. +TEST_F(AnswerCardSearchProviderTest, ThreeQueriesSecondNoCard) { + // 1. Fetch for cat. + EXPECT_CALL(*contents1(), LoadURL(GetSearchUrl(kCatQuery))); + provider()->Start(false, base::UTF8ToUTF16(kCatQuery)); + provider()->DidFinishNavigation(contents1(), GetSearchUrl(kCatQuery), false, + true, kCatCardTitle, kCatQuery); + provider()->DidStopLoading(contents1()); + + VerifyResult("Cat Result 1", kCatCardId, view1(), kCatCardTitle); + + // 2. Fetch for dog. This will fail with an error. + EXPECT_CALL(*contents0(), LoadURL(GetSearchUrl(kDogQuery))); + provider()->Start(false, base::UTF8ToUTF16(kDogQuery)); + + VerifyResult("Cat Result 2", kCatCardId, view1(), kCatCardTitle); + + provider()->DidFinishNavigation(contents0(), GetSearchUrl(kDogQuery), false, + false, "", ""); + + EXPECT_EQ(0UL, results().size()); + + provider()->DidStopLoading(contents0()); + + EXPECT_EQ(0UL, results().size()); + + // 3. Fetch for shark. + EXPECT_CALL(*contents0(), LoadURL(GetSearchUrl(kSharkQuery))); + provider()->Start(false, base::UTF8ToUTF16(kSharkQuery)); + + EXPECT_EQ(0UL, results().size()); + + provider()->DidFinishNavigation(contents0(), GetSearchUrl(kSharkQuery), false, + true, kSharkCardTitle, kSharkQuery); + + EXPECT_EQ(0UL, results().size()); + + provider()->DidStopLoading(contents0()); + + VerifyResult("Shark Result", kSharkCardId, view0(), kSharkCardTitle); } // User enters a query character by character, so that each next query generates // a web request while the previous one is still in progress. Only the last // query should produce a result. TEST_F(AnswerCardSearchProviderTest, InterruptedRequest) { - EXPECT_CALL(*contents(), LoadURL(GetSearchUrl("c"))); + EXPECT_CALL(*contents1(), LoadURL(GetSearchUrl("c"))); provider()->Start(false, base::UTF8ToUTF16("c")); EXPECT_EQ(0UL, results().size()); - EXPECT_CALL(*contents(), LoadURL(GetSearchUrl("ca"))); + EXPECT_CALL(*contents1(), LoadURL(GetSearchUrl("ca"))); provider()->Start(false, base::UTF8ToUTF16("ca")); EXPECT_EQ(0UL, results().size()); - EXPECT_CALL(*contents(), LoadURL(GetSearchUrl(kCatQuery))); + EXPECT_CALL(*contents1(), LoadURL(GetSearchUrl(kCatQuery))); provider()->Start(false, base::UTF8ToUTF16(kCatQuery)); EXPECT_EQ(0UL, results().size()); - provider()->DidFinishNavigation(GetSearchUrl("c"), false, true, "Title c", - "c"); - provider()->DidStopLoading(); + provider()->DidFinishNavigation(contents1(), GetSearchUrl("c"), false, true, + "Title c", "c"); + provider()->DidStopLoading(contents1()); EXPECT_EQ(0UL, results().size()); - provider()->DidFinishNavigation(GetSearchUrl("ca"), false, true, "Title ca", - "ca"); - provider()->DidStopLoading(); - provider()->UpdatePreferredSize(gfx::Size(1, 1)); + provider()->DidFinishNavigation(contents1(), GetSearchUrl("ca"), false, true, + "Title ca", "ca"); + provider()->DidStopLoading(contents1()); EXPECT_EQ(0UL, results().size()); - provider()->DidFinishNavigation(GetSearchUrl(kCatQuery), false, true, - kCatCardTitle, kCatQuery); - provider()->DidStopLoading(); - provider()->UpdatePreferredSize(GetMaxValidCardSize()); - EXPECT_EQ(1UL, results().size()); + provider()->DidFinishNavigation(contents1(), GetSearchUrl(kCatQuery), false, + true, kCatCardTitle, kCatQuery); + provider()->DidStopLoading(contents1()); - SearchResult* result = results()[0].get(); - EXPECT_EQ(SearchResult::DISPLAY_CARD, result->display_type()); - EXPECT_EQ(kCatCardId, result->id()); - EXPECT_EQ(base::UTF8ToUTF16(kCatCardTitle), result->title()); + VerifyResult("Cat Result", kCatCardId, view1(), kCatCardTitle); } -// Due to, for example, JS activity in the card, it can change its size after -// loading. We should hide the result while its size if larger than the allowed -// maximum. -TEST_F(AnswerCardSearchProviderTest, ChangingSize) { - EXPECT_CALL(*contents(), LoadURL(GetSearchUrl(kCatQuery))); +// After seeing a result, the user enters a query character by character. The +// result will stay until we get an uninterrupted answer. +TEST_F(AnswerCardSearchProviderTest, InterruptedRequestAfterResult) { + EXPECT_CALL(*contents1(), LoadURL(GetSearchUrl(kCatQuery))); provider()->Start(false, base::UTF8ToUTF16(kCatQuery)); - provider()->DidFinishNavigation(GetSearchUrl(kCatQuery), false, true, - kCatCardTitle, kCatQuery); - provider()->UpdatePreferredSize(gfx::Size(features::AnswerCardMaxWidth() + 1, - features::AnswerCardMaxHeight())); - provider()->DidStopLoading(); - EXPECT_EQ(0UL, results().size()); + provider()->DidFinishNavigation(contents1(), GetSearchUrl(kCatQuery), false, + true, kCatCardTitle, kCatQuery); + provider()->DidStopLoading(contents1()); - provider()->UpdatePreferredSize(GetMaxValidCardSize()); - EXPECT_EQ(1UL, results().size()); + VerifyResult("Cat Result 1", kCatCardId, view1(), kCatCardTitle); - provider()->UpdatePreferredSize(gfx::Size( - features::AnswerCardMaxWidth(), features::AnswerCardMaxHeight() + 1)); - EXPECT_EQ(0UL, results().size()); + EXPECT_CALL(*contents0(), LoadURL(GetSearchUrl("d"))); + provider()->Start(false, base::UTF8ToUTF16("d")); - provider()->UpdatePreferredSize(GetMaxValidCardSize()); - EXPECT_EQ(1UL, results().size()); + VerifyResult("Cat Result 2", kCatCardId, view1(), kCatCardTitle); + + EXPECT_CALL(*contents0(), LoadURL(GetSearchUrl("do"))); + provider()->Start(false, base::UTF8ToUTF16("do")); + + VerifyResult("Cat Result 3", kCatCardId, view1(), kCatCardTitle); + + EXPECT_CALL(*contents0(), LoadURL(GetSearchUrl(kDogQuery))); + provider()->Start(false, base::UTF8ToUTF16(kDogQuery)); + + VerifyResult("Cat Result 4", kCatCardId, view1(), kCatCardTitle); + + provider()->DidFinishNavigation(contents0(), GetSearchUrl("d"), false, true, + "Title d", "d"); + provider()->DidStopLoading(contents0()); + + VerifyResult("Cat Result 5", kCatCardId, view1(), kCatCardTitle); + + provider()->DidFinishNavigation(contents0(), GetSearchUrl("do"), false, true, + "Title do", "do"); + provider()->DidStopLoading(contents0()); + + VerifyResult("Cat Result 5", kCatCardId, view1(), kCatCardTitle); + + provider()->DidFinishNavigation(contents0(), GetSearchUrl(kDogQuery), false, + true, kDogCardTitle, kDogQuery); + provider()->DidStopLoading(contents0()); + + VerifyResult("Dog Result", kDogCardId, view0(), kDogCardTitle); } // Various values for DidFinishNavigation params. TEST_F(AnswerCardSearchProviderTest, DidFinishNavigation) { - TestDidFinishNavigation(false, true, kCatCardTitle, kCatQuery, 1UL); - TestDidFinishNavigation(true, true, kCatCardTitle, kCatQuery, 0UL); - TestDidFinishNavigation(false, false, kCatCardTitle, "", 0UL); + TestDidFinishNavigation(1, false, true, kCatCardTitle, kCatQuery, 1UL); + TestDidFinishNavigation(0, true, true, kCatCardTitle, kCatQuery, 0UL); + TestDidFinishNavigation(0, false, false, kCatCardTitle, "", 0UL); } // Escaping a query with a special character. TEST_F(AnswerCardSearchProviderTest, QueryEscaping) { - EXPECT_CALL(*contents(), LoadURL(GetSearchUrl("cat%26dog"))); + EXPECT_CALL(*contents1(), LoadURL(GetSearchUrl("cat%26dog"))); provider()->Start(false, base::UTF8ToUTF16("cat&dog")); }
diff --git a/chrome/browser/ui/app_list/search/answer_card/answer_card_web_contents.cc b/chrome/browser/ui/app_list/search/answer_card/answer_card_web_contents.cc index bc6b63f..b25e7c5f0 100644 --- a/chrome/browser/ui/app_list/search/answer_card/answer_card_web_contents.cc +++ b/chrome/browser/ui/app_list/search/answer_card/answer_card_web_contents.cc
@@ -140,10 +140,6 @@ web_contents_->GetRenderViewHost()->EnablePreferredSizeMode(); } -bool AnswerCardWebContents::IsLoading() const { - return web_contents_->IsLoading(); -} - views::View* AnswerCardWebContents::GetView() { return web_view_.get(); } @@ -151,7 +147,7 @@ void AnswerCardWebContents::UpdatePreferredSize( content::WebContents* web_contents, const gfx::Size& pref_size) { - delegate()->UpdatePreferredSize(pref_size); + delegate()->UpdatePreferredSize(this); web_view_->SetPreferredSize(pref_size); } @@ -208,12 +204,12 @@ &has_answer_card, &result_title, &issued_query); } - delegate()->DidFinishNavigation(navigation_handle->GetURL(), has_error, + delegate()->DidFinishNavigation(this, navigation_handle->GetURL(), has_error, has_answer_card, result_title, issued_query); } void AnswerCardWebContents::DidStopLoading() { - delegate()->DidStopLoading(); + delegate()->DidStopLoading(this); } void AnswerCardWebContents::DidGetUserInteraction(
diff --git a/chrome/browser/ui/app_list/search/answer_card/answer_card_web_contents.h b/chrome/browser/ui/app_list/search/answer_card/answer_card_web_contents.h index ffb6aac..3c88379 100644 --- a/chrome/browser/ui/app_list/search/answer_card/answer_card_web_contents.h +++ b/chrome/browser/ui/app_list/search/answer_card/answer_card_web_contents.h
@@ -30,7 +30,6 @@ // AnswerCardContents overrides: void LoadURL(const GURL& url) override; - bool IsLoading() const override; views::View* GetView() override; // content::WebContentsDelegate overrides:
diff --git a/chrome/browser/ui/app_list/search/omnibox_result.cc b/chrome/browser/ui/app_list/search/omnibox_result.cc index 7163209..eca42b3 100644 --- a/chrome/browser/ui/app_list/search/omnibox_result.cc +++ b/chrome/browser/ui/app_list/search/omnibox_result.cc
@@ -174,6 +174,9 @@ // See comments in autocomplete_provider.h. set_relevance(match_.relevance / 1500.0); + if (AutocompleteMatch::IsSearchType(match_.type)) + set_is_omnibox_search(true); + UpdateIcon(); UpdateTitleAndDetails(); @@ -228,23 +231,39 @@ } void OmniboxResult::UpdateTitleAndDetails() { - set_title(match_.contents); + // For url result with non-empty description, swap title and details. Thus, + // the url description is presented as title, and url itself is presented as + // details. + const bool use_directly = + !is_fullscreen_app_list_enabled_ || !IsUrlResultWithDescription(); SearchResult::Tags title_tags; - ACMatchClassificationsToTags(match_.contents, match_.contents_class, - &title_tags); + if (use_directly) { + set_title(match_.contents); + ACMatchClassificationsToTags(match_.contents, match_.contents_class, + &title_tags); + } else { + set_title(match_.description); + ACMatchClassificationsToTags(match_.description, match_.description_class, + &title_tags); + } set_title_tags(title_tags); - // Do not set details for omnibox non-url search result. This will make - // SearchResultView show single line row for omnibox non-url search result. - if (!is_fullscreen_app_list_enabled_ || - !AutocompleteMatch::IsSearchType(match_.type)) { - set_is_url(true); + SearchResult::Tags details_tags; + if (use_directly) { set_details(match_.description); - SearchResult::Tags details_tags; ACMatchClassificationsToTags(match_.description, match_.description_class, &details_tags); - set_details_tags(details_tags); + } else { + set_details(match_.contents); + ACMatchClassificationsToTags(match_.contents, match_.contents_class, + &details_tags); } + set_details_tags(details_tags); +} + +bool OmniboxResult::IsUrlResultWithDescription() const { + return !AutocompleteMatch::IsSearchType(match_.type) && + !match_.description.empty(); } } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/omnibox_result.h b/chrome/browser/ui/app_list/search/omnibox_result.h index 49b4058..db972e5 100644 --- a/chrome/browser/ui/app_list/search/omnibox_result.h +++ b/chrome/browser/ui/app_list/search/omnibox_result.h
@@ -36,6 +36,10 @@ void UpdateTitleAndDetails(); + // Returns true if |match_| indicates a url search result with non-empty + // description. + bool IsUrlResultWithDescription() const; + Profile* profile_; AppListControllerDelegate* list_controller_; AutocompleteController* autocomplete_controller_;
diff --git a/chrome/browser/ui/app_list/search/search_controller_factory.cc b/chrome/browser/ui/app_list/search/search_controller_factory.cc index e1792c0..3894c4b 100644 --- a/chrome/browser/ui/app_list/search/search_controller_factory.cc +++ b/chrome/browser/ui/app_list/search/search_controller_factory.cc
@@ -109,6 +109,7 @@ answer_card_group_id, base::MakeUnique<AnswerCardSearchProvider>( profile, model, list_controller, + base::MakeUnique<AnswerCardWebContents>(profile), base::MakeUnique<AnswerCardWebContents>(profile))); } if (IsSuggestionsSearchProviderEnabled()) {
diff --git a/chrome/browser/ui/cocoa/extensions/extension_message_bubble_browsertest_mac.mm b/chrome/browser/ui/cocoa/extensions/extension_message_bubble_browsertest_mac.mm index 95ca512..723b469 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_message_bubble_browsertest_mac.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_message_bubble_browsertest_mac.mm
@@ -268,3 +268,8 @@ TestControlledNewTabPageMessageBubble) { TestControlledNewTabPageBubbleShown(false); } + +IN_PROC_BROWSER_TEST_F(NtpBubbleBrowserTestMac, + TestBubbleClosedAfterExtensionUninstall) { + TestBubbleClosedAfterExtensionUninstall(); +}
diff --git a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm index 28b5696..16814b7 100644 --- a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm +++ b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm
@@ -6,6 +6,7 @@ #include <utility> +#include "base/mac/bind_objc_block.h" #include "base/mac/foundation_util.h" #include "base/strings/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/info_bubble_view.h" @@ -16,8 +17,8 @@ #include "third_party/skia/include/core/SkColor.h" #import "ui/base/cocoa/controls/hyperlink_button_cell.h" #import "ui/base/cocoa/hover_button.h" -#include "ui/base/resource/resource_bundle.h" #import "ui/base/cocoa/window_size_constants.h" +#include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image_skia_util_mac.h" #include "ui/gfx/paint_vector_icon.h" @@ -110,7 +111,13 @@ } - (IBAction)showWindow:(id)sender { - delegate_->OnBubbleShown(); + // The capturing lambda below is safe because the block creates a strong + // reference to |self|. The Block_copy operator automatically retains object + // variables, and when the block is destroyed, the variables are automatically + // released. + delegate_->OnBubbleShown(base::BindBlock(^{ + [self close]; + })); [super showWindow:sender]; }
diff --git a/chrome/browser/ui/extensions/blocked_action_bubble_delegate.cc b/chrome/browser/ui/extensions/blocked_action_bubble_delegate.cc index 232b5d0..332dd3e 100644 --- a/chrome/browser/ui/extensions/blocked_action_bubble_delegate.cc +++ b/chrome/browser/ui/extensions/blocked_action_bubble_delegate.cc
@@ -57,7 +57,8 @@ return extension_id_; } -void BlockedActionBubbleDelegate::OnBubbleShown() {} +void BlockedActionBubbleDelegate::OnBubbleShown( + const base::Closure& close_bubble_callback) {} void BlockedActionBubbleDelegate::OnBubbleClosed(CloseAction action) { base::ResetAndReturn(&callback_).Run(action);
diff --git a/chrome/browser/ui/extensions/blocked_action_bubble_delegate.h b/chrome/browser/ui/extensions/blocked_action_bubble_delegate.h index 51df893..2c63c2d 100644 --- a/chrome/browser/ui/extensions/blocked_action_bubble_delegate.h +++ b/chrome/browser/ui/extensions/blocked_action_bubble_delegate.h
@@ -30,7 +30,7 @@ std::unique_ptr<ToolbarActionsBarBubbleDelegate::ExtraViewInfo> GetExtraViewInfo() override; std::string GetAnchorActionId() override; - void OnBubbleShown() override; + void OnBubbleShown(const base::Closure& close_bubble_callback) override; void OnBubbleClosed(CloseAction action) override; base::Callback<void(CloseAction)> callback_;
diff --git a/chrome/browser/ui/extensions/extension_message_bubble_bridge.cc b/chrome/browser/ui/extensions/extension_message_bubble_bridge.cc index 6db09936..c1fbe33 100644 --- a/chrome/browser/ui/extensions/extension_message_bubble_bridge.cc +++ b/chrome/browser/ui/extensions/extension_message_bubble_bridge.cc
@@ -81,8 +81,9 @@ : std::string(); } -void ExtensionMessageBubbleBridge::OnBubbleShown() { - controller_->OnShown(); +void ExtensionMessageBubbleBridge::OnBubbleShown( + const base::Closure& close_bubble_callback) { + controller_->OnShown(close_bubble_callback); } void ExtensionMessageBubbleBridge::OnBubbleClosed(CloseAction action) {
diff --git a/chrome/browser/ui/extensions/extension_message_bubble_bridge.h b/chrome/browser/ui/extensions/extension_message_bubble_bridge.h index 3d4a6ac..3e2dabe 100644 --- a/chrome/browser/ui/extensions/extension_message_bubble_bridge.h +++ b/chrome/browser/ui/extensions/extension_message_bubble_bridge.h
@@ -36,7 +36,7 @@ base::string16 GetLearnMoreButtonText() override; std::unique_ptr<ExtraViewInfo> GetExtraViewInfo() override; std::string GetAnchorActionId() override; - void OnBubbleShown() override; + void OnBubbleShown(const base::Closure& close_bubble_callback) override; void OnBubbleClosed(CloseAction action) override; std::unique_ptr<extensions::ExtensionMessageBubbleController> controller_;
diff --git a/chrome/browser/ui/extensions/extension_message_bubble_browsertest.cc b/chrome/browser/ui/extensions/extension_message_bubble_browsertest.cc index f2557f4..2ea1480 100644 --- a/chrome/browser/ui/extensions/extension_message_bubble_browsertest.cc +++ b/chrome/browser/ui/extensions/extension_message_bubble_browsertest.cc
@@ -170,6 +170,31 @@ CloseBubble(second_browser); } +void ExtensionMessageBubbleBrowserTest:: + TestBubbleClosedAfterExtensionUninstall() { + const extensions::Extension* extension = + LoadExtension(test_data_dir_.AppendASCII("api_test") + .AppendASCII("override") + .AppendASCII("newtab")); + ASSERT_TRUE(extension); + + CheckBubbleIsNotPresent(browser(), false, false); + EXPECT_EQ(1, browser()->tab_strip_model()->count()); + chrome::NewTab(browser()); + EXPECT_EQ(2, browser()->tab_strip_model()->count()); + base::RunLoop().RunUntilIdle(); + CheckBubble(browser(), ANCHOR_BROWSER_ACTION, false); + + extension_service()->UninstallExtension( + extension->id(), extensions::UNINSTALL_REASON_FOR_TESTING, + base::Bind(&base::DoNothing), nullptr); + base::RunLoop().RunUntilIdle(); + + // If the only relevant extension was uninstalled, the bubble should + // automatically close. See crbug.com/748952. + CheckBubbleIsNotPresent(browser(), false, false); +} + void ExtensionMessageBubbleBrowserTest::TestUninstallDangerousExtension() { // Load an extension that overrides the proxy setting. ExtensionTestMessageListener listener("registered", false);
diff --git a/chrome/browser/ui/extensions/extension_message_bubble_browsertest.h b/chrome/browser/ui/extensions/extension_message_bubble_browsertest.h index 10fd818..271712b 100644 --- a/chrome/browser/ui/extensions/extension_message_bubble_browsertest.h +++ b/chrome/browser/ui/extensions/extension_message_bubble_browsertest.h
@@ -92,6 +92,10 @@ // Regression test for crbug.com/485614. void TestBubbleAnchoredToAppMenuWithOtherAction(); + // Tests that a displayed extension bubble will be closed after its associated + // extension is uninstalled. + void TestBubbleClosedAfterExtensionUninstall(); + // Tests that uninstalling the extension between when the bubble is originally // slated to show and when it does show is handled gracefully. // Regression test for crbug.com/531648.
diff --git a/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.cc b/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.cc index 6f3913c..518ef94 100644 --- a/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.cc +++ b/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.cc
@@ -34,8 +34,14 @@ void ChromePDFWebContentsHelperClient::UpdateContentRestrictions( content::WebContents* contents, int content_restrictions) { + // Speculative short-term-fix while we get at the root of + // https://crbug.com/752822 . + content::WebContents* web_contents_to_use = GetWebContentsToUse(contents); + if (!web_contents_to_use) + return; + CoreTabHelper* core_tab_helper = - CoreTabHelper::FromWebContents(GetWebContentsToUse(contents)); + CoreTabHelper::FromWebContents(web_contents_to_use); // |core_tab_helper| is NULL for WebViewGuest. if (core_tab_helper) core_tab_helper->UpdateContentRestrictions(content_restrictions);
diff --git a/chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.cc b/chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.cc index 69b1a442..08944bf 100644 --- a/chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.cc +++ b/chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.cc
@@ -38,7 +38,7 @@ return nullptr; } std::string GetAnchorActionId() override { return std::string(); } - void OnBubbleShown() override { + void OnBubbleShown(const base::Closure& close_bubble_callback) override { CHECK(!parent_->shown_); parent_->shown_ = true; }
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h b/chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h index 189df92..b19550f1 100644 --- a/chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h +++ b/chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/callback_forward.h" #include "base/strings/string16.h" namespace gfx { @@ -81,8 +82,9 @@ // bubble should point to the center of the actions container. virtual std::string GetAnchorActionId() = 0; - // Called when the bubble is shown. - virtual void OnBubbleShown() = 0; + // Called when the bubble is shown. Accepts a callback from platform-specifc + // ui code to close the bubble. + virtual void OnBubbleShown(const base::Closure& close_bubble_callback) = 0; // Called when the bubble is closed with the type of action the user took. virtual void OnBubbleClosed(CloseAction action) = 0;
diff --git a/chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc b/chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc index 696620c..2ea4f4ed 100644 --- a/chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc
@@ -281,3 +281,8 @@ TestControlledNewTabPageMessageBubbleLearnMore) { TestControlledNewTabPageBubbleShown(true); } + +IN_PROC_BROWSER_TEST_F(NtpExtensionBubbleViewBrowserTest, + TestBubbleClosedAfterExtensionUninstall) { + TestBubbleClosedAfterExtensionUninstall(); +}
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 4f3b730..b1af153 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -2023,12 +2023,8 @@ // BrowserView, ui::AcceleratorTarget overrides: bool BrowserView::AcceleratorPressed(const ui::Accelerator& accelerator) { - std::map<ui::Accelerator, int>::const_iterator iter = - accelerator_table_.find(accelerator); - DCHECK(iter != accelerator_table_.end()); - int command_id = iter->second; - - if (accelerator.IsRepeat() && !IsCommandRepeatable(command_id)) + const int command_id = GetAcceleratorId(accelerator); + if (command_id == kUnknownAcceleratorId) return false; chrome::BrowserCommandController* controller = browser_->command_controller(); @@ -2037,6 +2033,18 @@ return chrome::ExecuteCommand(browser_.get(), command_id); } +int BrowserView::GetAcceleratorId(const ui::Accelerator& accelerator) const { + std::map<ui::Accelerator, int>::const_iterator iter = + accelerator_table_.find(accelerator); + DCHECK(iter != accelerator_table_.end()); + + const int command_id = iter->second; + if (accelerator.IsRepeat() && !IsCommandRepeatable(command_id)) + return kUnknownAcceleratorId; + + return command_id; +} + /////////////////////////////////////////////////////////////////////////////// // BrowserView, OmniboxPopupModelObserver overrides: void BrowserView::OnOmniboxPopupShownOrHidden() {
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h index 665a1cfa..71aaa893 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -442,6 +442,7 @@ // Overridden from ui::AcceleratorTarget: bool AcceleratorPressed(const ui::Accelerator& accelerator) override; + int GetAcceleratorId(const ui::Accelerator& accelerator) const override; // OmniboxPopupModelObserver overrides void OnOmniboxPopupShownOrHidden() override;
diff --git a/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc b/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc index 0a59b0c..19bd0ba 100644 --- a/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc +++ b/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc
@@ -22,11 +22,11 @@ #include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" #include "content/public/test/test_utils.h" +#include "ui/message_center/message_center.h" #include "ui/message_center/message_center_style.h" #include "ui/message_center/message_center_tray.h" #include "ui/message_center/notification_list.h" #include "ui/message_center/notification_types.h" -#include "ui/message_center/views/message_center_bubble.h" #include "ui/message_center/views/message_popup_collection.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" @@ -34,43 +34,47 @@ #include "ui/views/widget/widget.h" namespace message_center { - namespace { +class TestNotificationDelegate : public ::NotificationDelegate { + public: + explicit TestNotificationDelegate(const std::string& id) : id_(id) {} + std::string id() const override { return id_; } + + private: + ~TestNotificationDelegate() override {} + + std::string id_; + + DISALLOW_COPY_AND_ASSIGN(TestNotificationDelegate); +}; + +::Notification MakeNotification(const std::string& delegate_id, + const std::string& replace_id) { + return ::Notification( + NOTIFICATION_TYPE_SIMPLE, base::ASCIIToUTF16("Test Web Notification"), + base::ASCIIToUTF16("Notification message body."), gfx::Image(), + NotifierId(NotifierId::APPLICATION, replace_id), + base::ASCIIToUTF16("Some Chrome extension"), + GURL("chrome-extension://abbccedd"), replace_id, RichNotificationData(), + new TestNotificationDelegate(delegate_id)); +} + class WebNotificationTrayTest : public InProcessBrowserTest { public: WebNotificationTrayTest() {} ~WebNotificationTrayTest() override {} void TearDownOnMainThread() override { - message_center::MessageCenter::Get()->RemoveAllNotifications(false); + MessageCenter::Get()->RemoveAllNotifications( + false, MessageCenter::RemoveType::ALL); } protected: - class TestNotificationDelegate : public ::NotificationDelegate { - public: - explicit TestNotificationDelegate(const std::string& id) : id_(id) {} - std::string id() const override { return id_; } - - private: - ~TestNotificationDelegate() override {} - - std::string id_; - }; - void AddNotification(const std::string& delegate_id, const std::string& replace_id) { - ::Notification notification( - GURL("chrome-extension://abbccedd"), - base::ASCIIToUTF16("Test Web Notification"), - base::ASCIIToUTF16("Notification message body."), - gfx::Image(), - base::string16(), - replace_id, - new TestNotificationDelegate(delegate_id)); - - g_browser_process->notification_ui_manager()->Add(notification, - browser()->profile()); + g_browser_process->notification_ui_manager()->Add( + MakeNotification(delegate_id, replace_id), browser()->profile()); } std::string FindNotificationIdByDelegateId(const std::string& delegate_id) { @@ -84,16 +88,8 @@ void UpdateNotification(const std::string& replace_id, const std::string& new_id) { - ::Notification notification(GURL("chrome-extension://abbccedd"), - base::ASCIIToUTF16("Updated Web Notification"), - base::ASCIIToUTF16("Updated message body."), - gfx::Image(), - base::string16(), - replace_id, - new TestNotificationDelegate(new_id)); - - g_browser_process->notification_ui_manager()->Add(notification, - browser()->profile()); + g_browser_process->notification_ui_manager()->Add( + MakeNotification(new_id, replace_id), browser()->profile()); } void RemoveNotification(const std::string& id) { @@ -101,8 +97,7 @@ id, NotificationUIManager::GetProfileID(browser()->profile())); } - bool HasNotification(message_center::MessageCenter* message_center, - const std::string& id) { + bool HasNotification(MessageCenter* message_center, const std::string& id) { return message_center->FindVisibleNotificationById(id) != NULL; } @@ -110,13 +105,9 @@ DISALLOW_COPY_AND_ASSIGN(WebNotificationTrayTest); }; -} // namespace - - // TODO(dewittj): More exhaustive testing. IN_PROC_BROWSER_TEST_F(WebNotificationTrayTest, WebNotifications) { - message_center::MessageCenter* message_center = - message_center::MessageCenter::Get(); + MessageCenter* message_center = MessageCenter::Get(); // Add a notification. AddNotification("test_id1", "replace_id1"); @@ -149,31 +140,27 @@ IN_PROC_BROWSER_TEST_F(WebNotificationTrayTest, WebNotificationPopupBubble) { std::unique_ptr<WebNotificationTray> tray(new WebNotificationTray()); - tray->message_center(); // Adding a notification should show the popup bubble. AddNotification("test_id1", "replace_id1"); - EXPECT_TRUE(tray->message_center_tray_->popups_visible()); + EXPECT_TRUE(tray->GetMessageCenterTray()->popups_visible()); // Updating a notification should not hide the popup bubble. AddNotification("test_id2", "replace_id2"); UpdateNotification("replace_id2", "test_id3"); - EXPECT_TRUE(tray->message_center_tray_->popups_visible()); + EXPECT_TRUE(tray->GetMessageCenterTray()->popups_visible()); // Removing the first notification should not hide the popup bubble. RemoveNotification("test_id1"); - EXPECT_TRUE(tray->message_center_tray_->popups_visible()); + EXPECT_TRUE(tray->GetMessageCenterTray()->popups_visible()); // Removing the visible notification should hide the popup bubble. RemoveNotification("test_id3"); - EXPECT_FALSE(tray->message_center_tray_->popups_visible()); + EXPECT_FALSE(tray->GetMessageCenterTray()->popups_visible()); } -using message_center::NotificationList; - IN_PROC_BROWSER_TEST_F(WebNotificationTrayTest, ManyPopupNotifications) { std::unique_ptr<WebNotificationTray> tray(new WebNotificationTray()); - message_center::MessageCenter* message_center = tray->message_center(); // Add the max visible popup notifications +1, ensure the correct num visible. size_t notifications_to_add = kMaxVisiblePopupNotifications + 1; @@ -183,14 +170,13 @@ base::StringPrintf("replace_id%d", static_cast<int>(i)); AddNotification(id, replace_id); } - // Hide and reshow the bubble so that it is updated immediately, not delayed. - tray->message_center_tray_->HidePopupBubble(); - tray->message_center_tray_->ShowPopupBubble(); - EXPECT_TRUE(tray->message_center_tray_->popups_visible()); + EXPECT_TRUE(tray->GetMessageCenterTray()->popups_visible()); + MessageCenter* message_center = tray->message_center(); EXPECT_EQ(notifications_to_add, message_center->NotificationCount()); NotificationList::PopupNotifications popups = message_center->GetPopupNotifications(); EXPECT_EQ(kMaxVisiblePopupNotifications, popups.size()); } +} // namespace } // namespace message_center
diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc index 37de419f..96d8a1b 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
@@ -42,7 +42,14 @@ ToolbarActionsBarBubbleViews::~ToolbarActionsBarBubbleViews() {} void ToolbarActionsBarBubbleViews::Show() { - delegate_->OnBubbleShown(); + // Passing the Widget pointer (via GetWidget()) below in the lambda is safe + // because the controller, which eventually invokes the callback passed to + // OnBubbleShown, will never outlive the bubble view. This is because the + // ToolbarActionsBarBubbleView owns the ToolbarActionsBarBubbleDelegate. + // The ToolbarActionsBarBubbleDelegate is an ExtensionMessageBubbleBridge, + // which owns the ExtensionMessageBubbleController. + delegate_->OnBubbleShown( + base::Bind([](views::Widget* widget) { widget->Close(); }, GetWidget())); GetWidget()->Show(); }
diff --git a/chrome/browser/ui/webui/certificate_manager_localized_strings_provider.cc b/chrome/browser/ui/webui/certificate_manager_localized_strings_provider.cc new file mode 100644 index 0000000..88a3a34e --- /dev/null +++ b/chrome/browser/ui/webui/certificate_manager_localized_strings_provider.cc
@@ -0,0 +1,90 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/certificate_manager_localized_strings_provider.h" + +#include "build/build_config.h" +#include "chrome/grit/generated_resources.h" +#include "content/public/browser/web_ui_data_source.h" + +namespace certificate_manager { + +void AddLocalizedStrings(content::WebUIDataSource* html_source) { + struct { + const char* name; + int id; + } localized_strings[] = { + {"certificateManagerExpandA11yLabel", + IDS_SETTINGS_CERTIFICATE_MANAGER_EXPAND_ACCESSIBILITY_LABEL}, + {"certificateManagerNoCertificates", + IDS_SETTINGS_CERTIFICATE_MANAGER_NO_CERTIFICATES}, + {"certificateManagerYourCertificates", + IDS_SETTINGS_CERTIFICATE_MANAGER_YOUR_CERTIFICATES}, + {"certificateManagerYourCertificatesDescription", + IDS_SETTINGS_CERTIFICATE_MANAGER_YOUR_CERTIFICATES_DESCRIPTION}, + {"certificateManagerServers", IDS_SETTINGS_CERTIFICATE_MANAGER_SERVERS}, + {"certificateManagerServersDescription", + IDS_SETTINGS_CERTIFICATE_MANAGER_SERVERS_DESCRIPTION}, + {"certificateManagerAuthorities", + IDS_SETTINGS_CERTIFICATE_MANAGER_AUTHORITIES}, + {"certificateManagerAuthoritiesDescription", + IDS_SETTINGS_CERTIFICATE_MANAGER_AUTHORITIES_DESCRIPTION}, + {"certificateManagerOthers", IDS_SETTINGS_CERTIFICATE_MANAGER_OTHERS}, + {"certificateManagerOthersDescription", + IDS_SETTINGS_CERTIFICATE_MANAGER_OTHERS_DESCRIPTION}, + {"certificateManagerView", IDS_SETTINGS_CERTIFICATE_MANAGER_VIEW}, + {"certificateManagerImport", IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT}, + {"certificateManagerImportAndBind", + IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_AND_BIND}, + {"certificateManagerExport", IDS_SETTINGS_CERTIFICATE_MANAGER_EXPORT}, + {"certificateManagerDelete", IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE}, + {"certificateManagerDone", IDS_SETTINGS_CERTIFICATE_MANAGER_DONE}, + {"certificateManagerUntrusted", + IDS_SETTINGS_CERTIFICATE_MANAGER_UNTRUSTED}, + // CA trust edit dialog. + {"certificateManagerCaTrustEditDialogTitle", + IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_TITLE}, + {"certificateManagerCaTrustEditDialogDescription", + IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_DESCRIPTION}, + {"certificateManagerCaTrustEditDialogExplanation", + IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_EXPLANATION}, + {"certificateManagerCaTrustEditDialogSsl", + IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_SSL}, + {"certificateManagerCaTrustEditDialogEmail", + IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_EMAIL}, + {"certificateManagerCaTrustEditDialogObjSign", + IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_OBJ_SIGN}, + // Certificate delete confirmation dialog. + {"certificateManagerDeleteUserTitle", + IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_USER_TITLE}, + {"certificateManagerDeleteUserDescription", + IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_USER_DESCRIPTION}, + {"certificateManagerDeleteServerTitle", + IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_SERVER_TITLE}, + {"certificateManagerDeleteServerDescription", + IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_SERVER_DESCRIPTION}, + {"certificateManagerDeleteCaTitle", + IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_CA_TITLE}, + {"certificateManagerDeleteCaDescription", + IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_CA_DESCRIPTION}, + {"certificateManagerDeleteOtherTitle", + IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_OTHER_TITLE}, + // Encrypt/decrypt password dialogs. + {"certificateManagerEncryptPasswordTitle", + IDS_SETTINGS_CERTIFICATE_MANAGER_ENCRYPT_PASSWORD_TITLE}, + {"certificateManagerDecryptPasswordTitle", + IDS_SETTINGS_CERTIFICATE_MANAGER_DECRYPT_PASSWORD_TITLE}, + {"certificateManagerEncryptPasswordDescription", + IDS_SETTINGS_CERTIFICATE_MANAGER_ENCRYPT_PASSWORD_DESCRIPTION}, + {"certificateManagerPassword", IDS_SETTINGS_CERTIFICATE_MANAGER_PASSWORD}, + {"certificateManagerConfirmPassword", + IDS_SETTINGS_CERTIFICATE_MANAGER_CONFIRM_PASSWORD}, + {"certificateImportErrorFormat", + IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_ERROR_FORMAT}, + }; + for (const auto& entry : localized_strings) + html_source->AddLocalizedString(entry.name, entry.id); +} + +} // namespace certificate_manager
diff --git a/chrome/browser/ui/webui/certificate_manager_localized_strings_provider.h b/chrome/browser/ui/webui/certificate_manager_localized_strings_provider.h new file mode 100644 index 0000000..9b3dbbd9 --- /dev/null +++ b/chrome/browser/ui/webui/certificate_manager_localized_strings_provider.h
@@ -0,0 +1,21 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_CERTIFICATE_MANAGER_LOCALIZED_STRINGS_PROVIDER_H_ +#define CHROME_BROWSER_UI_WEBUI_CERTIFICATE_MANAGER_LOCALIZED_STRINGS_PROVIDER_H_ + +namespace content { +class WebUIDataSource; +} + +namespace certificate_manager { + +// Adds the strings needed for the certificate_manager component to +// |html_source|. String ids correspond to ids in +// ui/webui/resources/cr_components/certificate_manager/. +void AddLocalizedStrings(content::WebUIDataSource* html_source); + +} // namespace certificate_manager + +#endif // CHROME_BROWSER_UI_WEBUI_CERTIFICATE_MANAGER_LOCALIZED_STRINGS_PROVIDER_H_
diff --git a/chrome/browser/ui/webui/settings/certificates_handler.cc b/chrome/browser/ui/webui/certificates_handler.cc similarity index 96% rename from chrome/browser/ui/webui/settings/certificates_handler.cc rename to chrome/browser/ui/webui/certificates_handler.cc index b5c0c89..79df70e 100644 --- a/chrome/browser/ui/webui/settings/certificates_handler.cc +++ b/chrome/browser/ui/webui/certificates_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/settings/certificates_handler.h" +#include "chrome/browser/ui/webui/certificates_handler.h" #include <errno.h> #include <stddef.h> @@ -138,15 +138,6 @@ CertEquals(cert)) != web_trust_certs.end(); } -#if defined(OS_CHROMEOS) -void ShowCertificateViewerModalDialog(content::WebContents* web_contents, - gfx::NativeWindow parent, - net::X509Certificate* cert) { - CertificateViewerModalDialog* dialog = new CertificateViewerModalDialog(cert); - dialog->Show(web_contents, parent); -} -#endif - // Determine if |data| could be a PFX Protocol Data Unit. // This only does the minimum parsing necessary to distinguish a PFX file from a // DER encoded Certificate. @@ -187,7 +178,7 @@ } // namespace -namespace settings { +namespace certificate_manager { /////////////////////////////////////////////////////////////////////////////// // CertIdMap @@ -343,9 +334,8 @@ /////////////////////////////////////////////////////////////////////////////// // CertificatesHandler -CertificatesHandler::CertificatesHandler(bool show_certs_in_modal_dialog) - : show_certs_in_modal_dialog_(show_certs_in_modal_dialog), - requested_certificate_manager_model_(false), +CertificatesHandler::CertificatesHandler() + : requested_certificate_manager_model_(false), use_hardware_backed_(false), file_access_provider_(new FileAccessProvider()), cert_id_map_(new CertIdMap), @@ -473,13 +463,6 @@ net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args); if (!cert) return; -#if defined(OS_CHROMEOS) - if (show_certs_in_modal_dialog_) { - ShowCertificateViewerModalDialog(web_ui()->GetWebContents(), - GetParentWindow(), cert); - return; - } -#endif ShowCertificateViewer(web_ui()->GetWebContents(), GetParentWindow(), cert); } @@ -661,8 +644,9 @@ void CertificatesHandler::ImportPersonalFileSelected( const base::FilePath& path) { file_access_provider_->StartRead( - path, base::Bind(&CertificatesHandler::ImportPersonalFileRead, - base::Unretained(this)), + path, + base::Bind(&CertificatesHandler::ImportPersonalFileRead, + base::Unretained(this)), &tracker_); } @@ -808,8 +792,9 @@ void CertificatesHandler::ImportServerFileSelected(const base::FilePath& path) { file_access_provider_->StartRead( - path, base::Bind(&CertificatesHandler::ImportServerFileRead, - base::Unretained(this)), + path, + base::Bind(&CertificatesHandler::ImportServerFileRead, + base::Unretained(this)), &tracker_); } @@ -873,8 +858,9 @@ void CertificatesHandler::ImportCAFileSelected(const base::FilePath& path) { file_access_provider_->StartRead( - path, base::Bind(&CertificatesHandler::ImportCAFileRead, - base::Unretained(this)), + path, + base::Bind(&CertificatesHandler::ImportCAFileRead, + base::Unretained(this)), &tracker_); } @@ -1144,4 +1130,4 @@ return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); } -} // namespace settings +} // namespace certificate_manager
diff --git a/chrome/browser/ui/webui/settings/certificates_handler.h b/chrome/browser/ui/webui/certificates_handler.h similarity index 89% rename from chrome/browser/ui/webui/settings/certificates_handler.h rename to chrome/browser/ui/webui/certificates_handler.h index 839351e..04d605c 100644 --- a/chrome/browser/ui/webui/settings/certificates_handler.h +++ b/chrome/browser/ui/webui/certificates_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CERTIFICATES_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CERTIFICATES_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_CERTIFICATES_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_CERTIFICATES_HANDLER_H_ #include <memory> #include <string> @@ -13,28 +13,25 @@ #include "base/memory/weak_ptr.h" #include "base/task/cancelable_task_tracker.h" #include "chrome/browser/certificate_manager_model.h" -#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" +#include "content/public/browser/web_ui_message_handler.h" #include "net/cert/nss_cert_database.h" #include "ui/gfx/native_widget_types.h" #include "ui/shell_dialogs/select_file_dialog.h" -namespace settings { +namespace certificate_manager { class CertIdMap; class FileAccessProvider; -class CertificatesHandler - : public SettingsPageUIHandler, - public CertificateManagerModel::Observer, - public ui::SelectFileDialog::Listener { +class CertificatesHandler : public content::WebUIMessageHandler, + public CertificateManagerModel::Observer, + public ui::SelectFileDialog::Listener { public: - explicit CertificatesHandler(bool show_certs_in_modal_dialog); + CertificatesHandler(); ~CertificatesHandler() override; - // SettingsPageUIHandler implementation. + // content::WebUIMessageHandler. void RegisterMessages() override; - void OnJavascriptAllowed() override {} - void OnJavascriptDisallowed() override {} // CertificateManagerModel::Observer implementation. void CertificatesRefreshed() override; @@ -152,8 +149,8 @@ void RejectCallback(const base::Value& response); // Reject the pending JS callback with a generic error. - void RejectCallbackWithError( - const std::string& title, const std::string& error); + void RejectCallbackWithError(const std::string& title, + const std::string& error); // Reject the pending JS callback with a certificate import error. void RejectCallbackWithImportError( @@ -166,9 +163,6 @@ gfx::NativeWindow GetParentWindow() const; - // True if certificate viewer should be shown in modal instead of constrianed - // dialog. - bool show_certs_in_modal_dialog_; // The Certificates Manager model bool requested_certificate_manager_model_; std::unique_ptr<CertificateManagerModel> certificate_manager_model_; @@ -198,6 +192,6 @@ DISALLOW_COPY_AND_ASSIGN(CertificatesHandler); }; -} // namespace settings +} // namespace certificate_manager -#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CERTIFICATES_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_CERTIFICATES_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.cc b/chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.cc index fda473bef..1c29e0a 100644 --- a/chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.cc +++ b/chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.cc
@@ -4,159 +4,61 @@ #include "chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.h" -#include <memory> -#include <string> -#include <utility> - -#include "base/macros.h" -#include "base/memory/ptr_util.h" -#include "base/memory/ref_counted_memory.h" -#include "base/values.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/chromeos/system/input_device_settings.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/options/certificate_manager_handler.h" -#include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.h" -#include "chrome/common/chrome_constants.h" +#include "chrome/browser/ui/webui/certificate_manager_localized_strings_provider.h" +#include "chrome/browser/ui/webui/certificates_handler.h" +#include "chrome/browser/ui/webui/chromeos/bluetooth_dialog_localized_strings_provider.h" #include "chrome/common/url_constants.h" #include "chrome/grit/browser_resources.h" -#include "chromeos/chromeos_constants.h" -#include "content/public/browser/url_data_source.h" -#include "content/public/browser/web_contents.h" +#include "chrome/grit/generated_resources.h" +#include "components/strings/grit/components_strings.h" +#include "components/user_manager/user_manager.h" #include "content/public/browser/web_ui.h" -#include "content/public/browser/web_ui_message_handler.h" -#include "ui/base/resource/resource_bundle.h" -#include "ui/base/template_expressions.h" -#include "ui/base/webui/jstemplate_builder.h" -#include "ui/base/webui/web_ui_util.h" +#include "content/public/browser/web_ui_data_source.h" -using content::WebContents; -using content::WebUIMessageHandler; +namespace chromeos { namespace { -const char kLocalizedStringsFile[] = "strings.js"; - -class CertificateManagerDialogHTMLSource : public content::URLDataSource { - public: - explicit CertificateManagerDialogHTMLSource( - base::DictionaryValue* localized_strings); - - // content::URLDataSource implementation. - std::string GetSource() const override; - void StartDataRequest( - const std::string& path, - const content::ResourceRequestInfo::WebContentsGetter& wc_getter, - const content::URLDataSource::GotDataCallback& callback) override; - std::string GetMimeType(const std::string&) const override { - return "text/html"; - } - bool ShouldAddContentSecurityPolicy() const override { return false; } - bool AllowCaching() const override { - // Should not be cached to reflect dynamically-generated contents that may - // depend on current locale setting. - return false; - } - - protected: - ~CertificateManagerDialogHTMLSource() override {} - - private: - std::unique_ptr<base::DictionaryValue> localized_strings_; - - DISALLOW_COPY_AND_ASSIGN(CertificateManagerDialogHTMLSource); -}; - -CertificateManagerDialogHTMLSource::CertificateManagerDialogHTMLSource( - base::DictionaryValue* localized_strings) - : localized_strings_(localized_strings) { -} - -std::string CertificateManagerDialogHTMLSource::GetSource() const { - return chrome::kChromeUICertificateManagerHost; -} - -void CertificateManagerDialogHTMLSource::StartDataRequest( - const std::string& path, - const content::ResourceRequestInfo::WebContentsGetter& wc_getter, - const content::URLDataSource::GotDataCallback& callback) { - scoped_refptr<base::RefCountedMemory> response_bytes; - const std::string& app_locale = g_browser_process->GetApplicationLocale(); - webui::SetLoadTimeDataDefaults(app_locale, localized_strings_.get()); - - if (path == kLocalizedStringsFile) { - // Return dynamically-generated strings from memory. - std::string strings_js; - webui::AppendJsonJS(localized_strings_.get(), &strings_js); - response_bytes = base::RefCountedString::TakeString(&strings_js); - } else { - // Return (and cache) the main options html page as the default. - response_bytes = ui::ResourceBundle::GetSharedInstance(). - LoadDataResourceBytes(IDR_CERT_MANAGER_DIALOG_HTML); - // Pre-process i18n strings. - ui::TemplateReplacements replacements; - ui::TemplateReplacementsFromDictionaryValue(*localized_strings_, - &replacements); - std::string replaced = ui::ReplaceTemplateExpressions( - base::StringPiece(response_bytes->front_as<char>(), - response_bytes->size()), - replacements); - response_bytes = base::RefCountedString::TakeString(&replaced); - } - - callback.Run(response_bytes.get()); +void AddCertificateManagerStrings(content::WebUIDataSource* html_source) { + struct { + const char* name; + int id; + } localized_strings[] = { + {"cancel", IDS_CANCEL}, + {"close", IDS_CLOSE}, + {"edit", IDS_SETTINGS_EDIT}, + {"moreActions", IDS_SETTINGS_MORE_ACTIONS}, + {"ok", IDS_OK}, + }; + for (const auto& entry : localized_strings) + html_source->AddLocalizedString(entry.name, entry.id); + certificate_manager::AddLocalizedStrings(html_source); } } // namespace -namespace chromeos { - CertificateManagerDialogUI::CertificateManagerDialogUI(content::WebUI* web_ui) - : ui::WebDialogUI(web_ui), initialized_handlers_(false) { - // |localized_strings| will be owned by CertificateManagerDialogHTMLSource. - base::DictionaryValue* localized_strings = new base::DictionaryValue(); + : WebDialogUI(web_ui) { + content::WebUIDataSource* source = + content::WebUIDataSource::Create(chrome::kChromeUICertificateManagerHost); - auto core_handler = base::MakeUnique<options::CoreChromeOSOptionsHandler>(); - core_handler_ = core_handler.get(); - web_ui->AddMessageHandler(std::move(core_handler)); - core_handler_->set_handlers_host(this); - core_handler_->GetLocalizedValues(localized_strings); + AddCertificateManagerStrings(source); + source->AddBoolean( + "isGuest", + user_manager::UserManager::Get()->IsLoggedInAsGuest() || + user_manager::UserManager::Get()->IsLoggedInAsPublicAccount()); - auto cert_handler = - base::MakeUnique<::options::CertificateManagerHandler>(true); - cert_handler_ = cert_handler.get(); - web_ui->AddMessageHandler(std::move(cert_handler)); - cert_handler_->GetLocalizedValues(localized_strings); + source->SetJsonPath("strings.js"); + source->SetDefaultResource(IDR_CERT_MANAGER_DIALOG_HTML); + source->DisableContentSecurityPolicy(); - bool keyboard_driven_oobe = - system::InputDeviceSettings::Get()->ForceKeyboardDrivenUINavigation(); - localized_strings->SetString("highlightStrength", - keyboard_driven_oobe ? "strong" : "normal"); + web_ui->AddMessageHandler( + base::MakeUnique<certificate_manager::CertificatesHandler>()); - CertificateManagerDialogHTMLSource* source = - new CertificateManagerDialogHTMLSource(localized_strings); - Profile* profile = Profile::FromWebUI(web_ui); - content::URLDataSource::Add(profile, source); + content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source); } -CertificateManagerDialogUI::~CertificateManagerDialogUI() { - // Uninitialize all registered handlers. The base class owns them and it will - // eventually delete them. - core_handler_->Uninitialize(); - cert_handler_->Uninitialize(); -} - -void CertificateManagerDialogUI::InitializeHandlers() { - // A new web page DOM has been brought up in an existing renderer, causing - // this method to be called twice. In that case, don't initialize the handlers - // again. Compare with options_ui.cc. - if (!initialized_handlers_) { - core_handler_->InitializeHandler(); - cert_handler_->InitializeHandler(); - initialized_handlers_ = true; - } - core_handler_->InitializePage(); - cert_handler_->InitializePage(); -} +CertificateManagerDialogUI::~CertificateManagerDialogUI() {} } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.h b/chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.h index 374ceb2..01f4a44e 100644 --- a/chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.h +++ b/chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.h
@@ -6,34 +6,17 @@ #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_CERTIFICATE_MANAGER_DIALOG_UI_H_ #include "base/macros.h" -#include "chrome/browser/ui/webui/options/options_ui.h" #include "ui/web_dialogs/web_dialog_ui.h" -namespace options { -class CertificateManagerHandler; -} - namespace chromeos { -namespace options { -class CoreChromeOSOptionsHandler; -} - -// A WebUI to host certificate manager split from the main settings page. -class CertificateManagerDialogUI : public ui::WebDialogUI, - public ::options::OptionsPageUIHandlerHost { +// A WebUI to host certificate manager UI. +class CertificateManagerDialogUI : public ui::WebDialogUI { public: explicit CertificateManagerDialogUI(content::WebUI* web_ui); ~CertificateManagerDialogUI() override; private: - // Overridden from OptionsPageUIHandlerHost: - void InitializeHandlers() override; - - bool initialized_handlers_; - - ::options::CertificateManagerHandler* cert_handler_ = nullptr; - options::CoreChromeOSOptionsHandler* core_handler_ = nullptr; DISALLOW_COPY_AND_ASSIGN(CertificateManagerDialogUI); };
diff --git a/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.cc index 2acd08b..f77bd7f 100644 --- a/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h" +#include "base/command_line.h" #include "base/i18n/timezone.h" #include "chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.h" #include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen_view_observer.h" @@ -12,6 +13,10 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" +#include "chromeos/chromeos_switches.h" +#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_state.h" +#include "chromeos/network/network_state_handler.h" #include "components/login/localized_values_builder.h" #include "components/prefs/pref_service.h" #include "content/public/browser/web_contents.h" @@ -32,6 +37,11 @@ } ArcTermsOfServiceScreenHandler::~ArcTermsOfServiceScreenHandler() { + OobeUI* oobe_ui = GetOobeUI(); + if (oobe_ui) + oobe_ui->RemoveObserver(this); + chromeos::NetworkHandler::Get()->network_state_handler()->RemoveObserver( + this, FROM_HERE); system::TimezoneSettings::GetInstance()->RemoveObserver(this); for (auto& observer : observer_list_) observer.OnViewDestroyed(this); @@ -44,17 +54,41 @@ &ArcTermsOfServiceScreenHandler::HandleAccept); } -void ArcTermsOfServiceScreenHandler::UpdateTimeZone() { - const std::string country_code = base::CountryCodeForCurrentTimezone(); - if (country_code == last_applied_contry_code_) +void ArcTermsOfServiceScreenHandler::MaybeLoadPlayStoreToS( + bool ignore_network_state) { + const chromeos::NetworkState* default_network = + chromeos::NetworkHandler::Get() + ->network_state_handler() + ->DefaultNetwork(); + if (!ignore_network_state && !default_network) return; - last_applied_contry_code_ = country_code; - CallJS("setCountryCode", country_code); + const std::string country_code = base::CountryCodeForCurrentTimezone(); + CallJS("loadPlayStoreToS", country_code); +} + +void ArcTermsOfServiceScreenHandler::OnCurrentScreenChanged( + OobeScreen current_screen, + OobeScreen new_screen) { + if (new_screen != OobeScreen::SCREEN_GAIA_SIGNIN) + return; + + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); + if (!command_line->HasSwitch(chromeos::switches::kEnableArcOOBEOptIn)) + return; + + MaybeLoadPlayStoreToS(false); + StartNetworkAndTimeZoneObserving(); } void ArcTermsOfServiceScreenHandler::TimezoneChanged( const icu::TimeZone& timezone) { - UpdateTimeZone(); + MaybeLoadPlayStoreToS(false); +} + +void ArcTermsOfServiceScreenHandler::DefaultNetworkChanged( + const NetworkState* network) { + MaybeLoadPlayStoreToS(false); } void ArcTermsOfServiceScreenHandler::DeclareLocalizedValues( @@ -140,10 +174,24 @@ pref_handler_.reset(); } -void ArcTermsOfServiceScreenHandler::Initialize() { - if (!show_on_init_) +void ArcTermsOfServiceScreenHandler::StartNetworkAndTimeZoneObserving() { + if (network_time_zone_observing_) return; + chromeos::NetworkHandler::Get()->network_state_handler()->AddObserver( + this, FROM_HERE); + system::TimezoneSettings::GetInstance()->AddObserver(this); + network_time_zone_observing_ = true; +} + +void ArcTermsOfServiceScreenHandler::Initialize() { + if (!show_on_init_) { + // Send time zone information as soon as possible to able to pre-load the + // Play Store ToS. + GetOobeUI()->AddObserver(this); + return; + } + Show(); show_on_init_ = false; } @@ -158,11 +206,11 @@ // ToS then prefs::kArcEnabled is automatically reset in ArcSessionManager. profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, true); - system::TimezoneSettings::GetInstance()->AddObserver(this); - ShowScreen(kScreenId); - UpdateTimeZone(); + MaybeLoadPlayStoreToS(true); + StartNetworkAndTimeZoneObserving(); + pref_handler_.reset(new arc::ArcOptInPreferenceHandler( this, profile->GetPrefs())); pref_handler_->Start();
diff --git a/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h index f37747ee..37d630b 100644 --- a/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h
@@ -13,6 +13,8 @@ #include "chrome/browser/chromeos/arc/optin/arc_optin_preference_handler_observer.h" #include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen_view.h" #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" +#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" +#include "chromeos/network/network_state_handler_observer.h" #include "chromeos/settings/timezone_settings.h" namespace arc { @@ -26,7 +28,9 @@ : public BaseScreenHandler, public ArcTermsOfServiceScreenView, public arc::ArcOptInPreferenceHandlerObserver, - public system::TimezoneSettings::Observer { + public OobeUI::Observer, + public system::TimezoneSettings::Observer, + public chromeos::NetworkStateHandlerObserver { public: ArcTermsOfServiceScreenHandler(); ~ArcTermsOfServiceScreenHandler() override; @@ -44,9 +48,16 @@ void Show() override; void Hide() override; + // OobeUI::Observer: + void OnCurrentScreenChanged(OobeScreen current_screen, + OobeScreen new_screen) override; + // system::TimezoneSettings::Observer: void TimezoneChanged(const icu::TimeZone& timezone) override; + // chromeos::NetworkStateHandlerObserver: + void DefaultNetworkChanged(const NetworkState* network) override; + private: // BaseScreenHandler: void Initialize() override; @@ -55,7 +66,11 @@ void HandleSkip(); void HandleAccept(bool enable_backup_restore, bool enable_location_services); - void UpdateTimeZone(); + // Loads Play Store ToS content in case default network exists. If + // |ignore_network_state| is set then network state is not checked. + void MaybeLoadPlayStoreToS(bool ignore_network_state); + + void StartNetworkAndTimeZoneObserving(); // arc::ArcOptInPreferenceHandlerObserver: void OnMetricsModeChanged(bool enabled, bool managed) override; @@ -67,8 +82,8 @@ // Whether the screen should be shown right after initialization. bool show_on_init_ = false; - // To prevent redundant updates, keep last country code used for update. - std::string last_applied_contry_code_; + // Indicates that we already started network and time zone observing. + bool network_time_zone_observing_ = false; std::unique_ptr<arc::ArcOptInPreferenceHandler> pref_handler_;
diff --git a/chrome/browser/ui/webui/memory_internals_ui.cc b/chrome/browser/ui/webui/memory_internals_ui.cc index e03b93c..c5377d0 100644 --- a/chrome/browser/ui/webui/memory_internals_ui.cc +++ b/chrome/browser/ui/webui/memory_internals_ui.cc
@@ -132,8 +132,9 @@ // Note that ChildProcessData.id is a child ID and not an OS PID. const content::ChildProcessData& data = iter.GetData(); base::ProcessId proc_id = base::GetProcId(data.handle); - std::string desc = base::StringPrintf("Process %d [%s]", proc_id, - GetChildDescription(data).c_str()); + std::string desc = + base::StringPrintf("Process %lld [%s]", static_cast<long long>(proc_id), + GetChildDescription(data).c_str()); result.push_back(MakeProcessInfo(proc_id, std::move(desc))); } @@ -154,8 +155,9 @@ // Add browser process. base::ProcessId browser_pid = base::GetCurrentProcId(); result_list.push_back(MakeProcessInfo( - browser_pid, - base::StringPrintf("Process %d [Browser]", browser_pid).c_str())); + browser_pid, base::StringPrintf("Process %lld [Browser]", + static_cast<long long>(browser_pid)) + .c_str())); // Append renderer processes. auto iter = content::RenderProcessHost::AllHostsIterator(); @@ -166,8 +168,9 @@ // TODO(brettw) make a better description of the process, maybe see // what TaskManager does. result_list.push_back(MakeProcessInfo( - renderer_pid, - base::StringPrintf("Process %d [Renderer]", renderer_pid).c_str())); + renderer_pid, base::StringPrintf("Process %lld [Renderer]", + static_cast<long long>(renderer_pid)) + .c_str())); } iter.Advance(); }
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc index f482fab..f622641 100644 --- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -57,6 +57,10 @@ #include "chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win.h" #endif +#if defined(USE_NSS_CERTS) +#include "chrome/browser/ui/webui/certificate_manager_localized_strings_provider.h" +#endif + namespace settings { namespace { @@ -396,83 +400,6 @@ } #endif -#if defined(USE_NSS_CERTS) -void AddCertificateManagerStrings(content::WebUIDataSource* html_source) { - LocalizedString localized_strings[] = { - {"certificateManagerPageTitle", IDS_SETTINGS_CERTIFICATE_MANAGER}, - {"certificateManagerExpandA11yLabel", - IDS_SETTINGS_CERTIFICATE_MANAGER_EXPAND_ACCESSIBILITY_LABEL}, - {"certificateManagerNoCertificates", - IDS_SETTINGS_CERTIFICATE_MANAGER_NO_CERTIFICATES}, - {"certificateManagerYourCertificates", - IDS_SETTINGS_CERTIFICATE_MANAGER_YOUR_CERTIFICATES}, - {"certificateManagerYourCertificatesDescription", - IDS_SETTINGS_CERTIFICATE_MANAGER_YOUR_CERTIFICATES_DESCRIPTION}, - {"certificateManagerServers", IDS_SETTINGS_CERTIFICATE_MANAGER_SERVERS}, - {"certificateManagerServersDescription", - IDS_SETTINGS_CERTIFICATE_MANAGER_SERVERS_DESCRIPTION}, - {"certificateManagerAuthorities", - IDS_SETTINGS_CERTIFICATE_MANAGER_AUTHORITIES}, - {"certificateManagerAuthoritiesDescription", - IDS_SETTINGS_CERTIFICATE_MANAGER_AUTHORITIES_DESCRIPTION}, - {"certificateManagerOthers", IDS_SETTINGS_CERTIFICATE_MANAGER_OTHERS}, - {"certificateManagerOthersDescription", - IDS_SETTINGS_CERTIFICATE_MANAGER_OTHERS_DESCRIPTION}, - {"certificateManagerView", IDS_SETTINGS_CERTIFICATE_MANAGER_VIEW}, - {"certificateManagerImport", IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT}, - {"certificateManagerImportAndBind", - IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_AND_BIND}, - {"certificateManagerExport", IDS_SETTINGS_CERTIFICATE_MANAGER_EXPORT}, - {"certificateManagerDelete", IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE}, - {"certificateManagerDone", IDS_SETTINGS_CERTIFICATE_MANAGER_DONE}, - {"certificateManagerUntrusted", - IDS_SETTINGS_CERTIFICATE_MANAGER_UNTRUSTED}, - // CA trust edit dialog. - {"certificateManagerCaTrustEditDialogTitle", - IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_TITLE}, - {"certificateManagerCaTrustEditDialogDescription", - IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_DESCRIPTION}, - {"certificateManagerCaTrustEditDialogExplanation", - IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_EXPLANATION}, - {"certificateManagerCaTrustEditDialogSsl", - IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_SSL}, - {"certificateManagerCaTrustEditDialogEmail", - IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_EMAIL}, - {"certificateManagerCaTrustEditDialogObjSign", - IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_OBJ_SIGN}, - // Certificate delete confirmation dialog. - {"certificateManagerDeleteUserTitle", - IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_USER_TITLE}, - {"certificateManagerDeleteUserDescription", - IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_USER_DESCRIPTION}, - {"certificateManagerDeleteServerTitle", - IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_SERVER_TITLE}, - {"certificateManagerDeleteServerDescription", - IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_SERVER_DESCRIPTION}, - {"certificateManagerDeleteCaTitle", - IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_CA_TITLE}, - {"certificateManagerDeleteCaDescription", - IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_CA_DESCRIPTION}, - {"certificateManagerDeleteOtherTitle", - IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_OTHER_TITLE}, - // Encrypt/decrypt password dialogs. - {"certificateManagerEncryptPasswordTitle", - IDS_SETTINGS_CERTIFICATE_MANAGER_ENCRYPT_PASSWORD_TITLE}, - {"certificateManagerDecryptPasswordTitle", - IDS_SETTINGS_CERTIFICATE_MANAGER_DECRYPT_PASSWORD_TITLE}, - {"certificateManagerEncryptPasswordDescription", - IDS_SETTINGS_CERTIFICATE_MANAGER_ENCRYPT_PASSWORD_DESCRIPTION}, - {"certificateManagerPassword", IDS_SETTINGS_CERTIFICATE_MANAGER_PASSWORD}, - {"certificateManagerConfirmPassword", - IDS_SETTINGS_CERTIFICATE_MANAGER_CONFIRM_PASSWORD}, - {"certificateImportErrorFormat", - IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_ERROR_FORMAT}, - }; - AddLocalizedStringsBulk(html_source, localized_strings, - arraysize(localized_strings)); -} -#endif - void AddClearBrowsingDataStrings(content::WebUIDataSource* html_source) { LocalizedString localized_strings[] = { {"clearFollowingItemsFrom", IDS_SETTINGS_CLEAR_FOLLOWING_ITEMS_FROM}, @@ -2255,7 +2182,7 @@ #endif #if defined(USE_NSS_CERTS) - AddCertificateManagerStrings(html_source); + certificate_manager::AddLocalizedStrings(html_source); #endif #if defined(OS_CHROMEOS)
diff --git a/chrome/browser/ui/webui/settings/md_settings_ui.cc b/chrome/browser/ui/webui/settings/md_settings_ui.cc index 8014886..b5c33f9 100644 --- a/chrome/browser/ui/webui/settings/md_settings_ui.cc +++ b/chrome/browser/ui/webui/settings/md_settings_ui.cc
@@ -89,7 +89,7 @@ #endif // defined(OS_CHROMEOS) #if defined(USE_NSS_CERTS) -#include "chrome/browser/ui/webui/settings/certificates_handler.h" +#include "chrome/browser/ui/webui/certificates_handler.h" #elif defined(OS_WIN) || defined(OS_MACOSX) #include "chrome/browser/ui/webui/settings/native_certificates_handler.h" #endif // defined(USE_NSS_CERTS) @@ -117,7 +117,8 @@ AddSettingsPageUIHandler(base::MakeUnique<AppearanceHandler>(web_ui)); #if defined(USE_NSS_CERTS) - AddSettingsPageUIHandler(base::MakeUnique<CertificatesHandler>(false)); + AddSettingsPageUIHandler( + base::MakeUnique<certificate_manager::CertificatesHandler>()); #elif defined(OS_WIN) || defined(OS_MACOSX) AddSettingsPageUIHandler(base::MakeUnique<NativeCertificatesHandler>()); #endif // defined(USE_NSS_CERTS) @@ -294,9 +295,8 @@ } void MdSettingsUI::AddSettingsPageUIHandler( - std::unique_ptr<SettingsPageUIHandler> handler) { + std::unique_ptr<content::WebUIMessageHandler> handler) { DCHECK(handler); - handlers_.insert(handler.get()); web_ui()->AddMessageHandler(std::move(handler)); }
diff --git a/chrome/browser/ui/webui/settings/md_settings_ui.h b/chrome/browser/ui/webui/settings/md_settings_ui.h index ca826ef1..2d3fd4e 100644 --- a/chrome/browser/ui/webui/settings/md_settings_ui.h +++ b/chrome/browser/ui/webui/settings/md_settings_ui.h
@@ -17,14 +17,16 @@ #include "chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_state_change_observer_win.h" #endif +namespace content { +class WebUIMessageHandler; +} + namespace user_prefs { class PrefRegistrySyncable; } namespace settings { -class SettingsPageUIHandler; - // The WebUI handler for chrome://settings. class MdSettingsUI : public content::WebUIController, public content::WebContentsObserver { @@ -42,10 +44,8 @@ void DocumentOnLoadCompletedInMainFrame() override; private: - void AddSettingsPageUIHandler(std::unique_ptr<SettingsPageUIHandler> handler); - - // Weak references; all |handlers_| are owned by |web_ui()|. - std::unordered_set<SettingsPageUIHandler*> handlers_; + void AddSettingsPageUIHandler( + std::unique_ptr<content::WebUIMessageHandler> handler); base::Time load_start_time_;
diff --git a/chrome/common/extensions/api/automation.idl b/chrome/common/extensions/api/automation.idl index 994bdd2..073bdac2 100644 --- a/chrome/common/extensions/api/automation.idl +++ b/chrome/common/extensions/api/automation.idl
@@ -74,7 +74,6 @@ audio, banner, blockquote, - busyIndicator, button, buttonDropDown, canvas, @@ -114,7 +113,6 @@ iframe, iframePresentational, ignored, - imageMapLink, imageMap, image, inlineTextBox, @@ -145,7 +143,6 @@ meter, navigation, note, - outline, pane, paragraph, popUpButton, @@ -159,11 +156,8 @@ rowHeader, row, ruby, - ruler, svgRoot, - scrollArea, scrollBar, - seamlessWebArea, search, searchBox, slider, @@ -174,7 +168,6 @@ staticText, status, switch, - tabGroup, tabList, tabPanel, tab,
diff --git a/chrome/common/profiling/memlog.mojom b/chrome/common/profiling/memlog.mojom index eeaeebe..ebb42cb7 100644 --- a/chrome/common/profiling/memlog.mojom +++ b/chrome/common/profiling/memlog.mojom
@@ -14,7 +14,10 @@ // Adds a new platform-specific pipe to read memlog trace data from. // In normal usage, each child process will be given the other end of this // pipe. - AddSender(mojo.common.mojom.ProcessId pid, handle sender_pipe); + // + // This function has a return value so the caller can know when the + // connection has been established. + AddSender(mojo.common.mojom.ProcessId pid, handle sender_pipe) => (); // Dumps the memory log of the process with the given |pid| into // |output_file|.
diff --git a/chrome/installer/zucchini/BUILD.gn b/chrome/installer/zucchini/BUILD.gn index ababcb49..a6a4f5f 100644 --- a/chrome/installer/zucchini/BUILD.gn +++ b/chrome/installer/zucchini/BUILD.gn
@@ -114,6 +114,7 @@ "test_reference_reader.cc", "test_reference_reader.h", "typed_value_unittest.cc", + "zucchini_gen_unittest.cc", ] deps = [
diff --git a/chrome/installer/zucchini/equivalence_map.cc b/chrome/installer/zucchini/equivalence_map.cc index a938e644..fa5f46f0 100644 --- a/chrome/installer/zucchini/equivalence_map.cc +++ b/chrome/installer/zucchini/equivalence_map.cc
@@ -168,6 +168,13 @@ /******** EquivalenceMap ********/ EquivalenceMap::EquivalenceMap() = default; + +EquivalenceMap::EquivalenceMap( + const std::vector<EquivalenceCandidate>& equivalences) + : candidates_(equivalences) { + SortByDestination(); +} + EquivalenceMap::~EquivalenceMap() = default; void EquivalenceMap::Build(const std::vector<offset_t>& old_sa,
diff --git a/chrome/installer/zucchini/equivalence_map.h b/chrome/installer/zucchini/equivalence_map.h index 910ee05..28e26fc 100644 --- a/chrome/installer/zucchini/equivalence_map.h +++ b/chrome/installer/zucchini/equivalence_map.h
@@ -66,6 +66,9 @@ using const_iterator = std::vector<EquivalenceCandidate>::const_iterator; EquivalenceMap(); + // Initializes the object with |equivalences|. + explicit EquivalenceMap( + const std::vector<EquivalenceCandidate>& equivalences); ~EquivalenceMap(); // Finds relevant equivalences between |old_image| and |new_image|, using
diff --git a/chrome/installer/zucchini/image_index.cc b/chrome/installer/zucchini/image_index.cc index fd2e7bbf..d75d77e 100644 --- a/chrome/installer/zucchini/image_index.cc +++ b/chrome/installer/zucchini/image_index.cc
@@ -64,6 +64,18 @@ return *pos; } +std::vector<offset_t> ImageIndex::GetTargets(PoolTag pool) const { + size_t target_count = 0; + for (TypeTag type : GetTypeTags(pool)) + target_count += GetReferences(type).size(); + std::vector<offset_t> targets; + targets.reserve(target_count); + for (TypeTag type : GetTypeTags(pool)) + for (const auto& ref : GetReferences(type)) + targets.push_back(ref.target); + return targets; +} + bool ImageIndex::IsToken(offset_t location) const { TypeTag type = GetType(location);
diff --git a/chrome/installer/zucchini/image_index.h b/chrome/installer/zucchini/image_index.h index c256e59..c66f013 100644 --- a/chrome/installer/zucchini/image_index.h +++ b/chrome/installer/zucchini/image_index.h
@@ -53,6 +53,11 @@ PoolTag GetPoolTag(TypeTag type) const { return GetTraits(type).pool_tag; } + const std::vector<TypeTag>& GetTypeTags(PoolTag pool) const { + DCHECK_LT(pool.value(), pools_.size()); + return pools_[pool.value()].types; + } + // Returns true if |raw_image_[location]| is either: // - A raw value. // - The first byte of a reference. @@ -88,6 +93,9 @@ return types_[type.value()].references; } + // Creates and returns a vector of all targets in |pool|. + std::vector<offset_t> GetTargets(PoolTag pool) const; + // Returns the size of the image. size_t size() const { return raw_image_.size(); }
diff --git a/chrome/installer/zucchini/image_utils.h b/chrome/installer/zucchini/image_utils.h index 77d1e07..f187ae2 100644 --- a/chrome/installer/zucchini/image_utils.h +++ b/chrome/installer/zucchini/image_utils.h
@@ -103,6 +103,10 @@ return value & ~(offset_t(1) << kIndexMarkBitPosition); } +// Constant as placeholder for non-existing offset for an index. +constexpr offset_t kUnusedIndex = offset_t(-1); +static_assert(IsMarked(kUnusedIndex), "kUnusedIndex must be marked"); + // An Equivalence is a block of length |length| that approximately match in // |old_image| at an offset of |src_offset| and in |new_image| at an offset of // |dst_offset|. @@ -147,11 +151,11 @@ Element() = default; constexpr Element(ExecutableType exe_type, offset_t offset, offset_t length) : exe_type(exe_type), offset(offset), length(length) {} - constexpr explicit Element(ExecutableType exe_type, BufferRegion region) + constexpr Element(ExecutableType exe_type, const BufferRegion& region) : exe_type(exe_type), offset(base::checked_cast<offset_t>(region.offset)), length(base::checked_cast<offset_t>(region.size)) {} - constexpr explicit Element(BufferRegion region) + constexpr explicit Element(const BufferRegion& region) : Element(kExeTypeNoOp, region) {} // Returns the end offset of this element.
diff --git a/chrome/installer/zucchini/label_manager.h b/chrome/installer/zucchini/label_manager.h index 9b8d0af..82ec9318e 100644 --- a/chrome/installer/zucchini/label_manager.h +++ b/chrome/installer/zucchini/label_manager.h
@@ -32,10 +32,6 @@ // affects reference parsing, where we reject all references whose offsets // happen to be marked. -// Constant as placeholder for non-existing offset for an index. -constexpr offset_t kUnusedIndex = offset_t(-1); -static_assert(IsMarked(kUnusedIndex), "kUnusedIndex must be marked"); - // Base class for OrderedLabelManager and UnorderedLabelManager. class BaseLabelManager { public:
diff --git a/chrome/installer/zucchini/zucchini_gen.cc b/chrome/installer/zucchini/zucchini_gen.cc index 210148b8..cab9403 100644 --- a/chrome/installer/zucchini/zucchini_gen.cc +++ b/chrome/installer/zucchini/zucchini_gen.cc
@@ -22,17 +22,75 @@ } // namespace +std::vector<offset_t> MakeNewTargetsFromEquivalenceMap( + const std::vector<offset_t>& old_targets, + const std::vector<Equivalence>& equivalences) { + auto current_equivalence = equivalences.begin(); + std::vector<offset_t> new_targets; + new_targets.reserve(old_targets.size()); + for (offset_t src : old_targets) { + while (current_equivalence != equivalences.end() && + current_equivalence->src_end() <= src) + ++current_equivalence; + + if (current_equivalence != equivalences.end() && + current_equivalence->src_offset <= src) { + // Select the longest equivalence that contains |src|. In case of a tie, + // prefer equivalence with minimal |dst_offset|. + auto best_equivalence = current_equivalence; + for (auto next_equivalence = current_equivalence; + next_equivalence != equivalences.end() && + src >= next_equivalence->src_offset; + ++next_equivalence) { + if (next_equivalence->length > best_equivalence->length || + (next_equivalence->length == best_equivalence->length && + next_equivalence->dst_offset < best_equivalence->dst_offset)) { + // If an |next_equivalence| is longer or equal to |best_equivalence|, + // it can be show that |src < next_equivalence->src_end()| i.e., |src| + // is inside |next_equivalence|. + DCHECK_LT(src, next_equivalence->src_end()); + best_equivalence = next_equivalence; + } + } + new_targets.push_back(src - best_equivalence->src_offset + + best_equivalence->dst_offset); + } else { + new_targets.push_back(kUnusedIndex); + } + } + return new_targets; +} + +std::vector<offset_t> FindExtraTargets( + const std::vector<Reference>& new_references, + const EquivalenceMap& equivalence_map) { + auto equivalence = equivalence_map.begin(); + std::vector<offset_t> targets; + for (const Reference& ref : new_references) { + while (equivalence != equivalence_map.end() && + equivalence->eq.dst_end() <= ref.location) + ++equivalence; + + if (equivalence == equivalence_map.end()) + break; + if (ref.location >= equivalence->eq.dst_offset && !IsMarked(ref.target)) + targets.push_back(ref.target); + } + return targets; +} + bool GenerateEquivalencesAndExtraData(ConstBufferView new_image, const EquivalenceMap& equivalence_map, PatchElementWriter* patch_writer) { - // Store data in gaps in |new_image| before / between / after - // |equivalence_map| blocks as "extra data". Write to sinks separately to - // reduce churn. + // Make 2 passes through |equivalence_map| to reduce write churn. + // Pass 1: Write all equivalences. EquivalenceSink equivalences_sink; for (const EquivalenceCandidate& candidate : equivalence_map) equivalences_sink.PutNext(candidate.eq); patch_writer->SetEquivalenceSink(std::move(equivalences_sink)); + // Pass 2: Write data in gaps in |new_image| before / between after + // |equivalence_map| as "extra data". ExtraDataSink extra_data_sink; offset_t dst_offset = 0; for (const EquivalenceCandidate& candidate : equivalence_map) { @@ -56,27 +114,27 @@ // Visit |equivalence_map| blocks in |new_image| order. Find and emit all // bytewise differences. - offset_t base_offset = 0; + offset_t base_copy_offset = 0; for (const EquivalenceCandidate& candidate : equivalence_map) { Equivalence equivalence = candidate.eq; // For each bytewise delta from |old_image| to |new_image|, compute "copy // offset" and pass it along with delta to the sink. - for (offset_t i = 0; i < candidate.eq.length; ++i) { + for (offset_t i = 0; i < equivalence.length; ++i) { if (new_image_index.IsReference(equivalence.dst_offset + i)) - continue; + continue; // Skip references since they're handled elsewhere. int8_t diff = new_image[equivalence.dst_offset + i] - old_image[equivalence.src_offset + i]; if (diff) - raw_delta_sink.PutNext({base_offset + i, diff}); + raw_delta_sink.PutNext({base_copy_offset + i, diff}); } - base_offset += equivalence.length; + base_copy_offset += equivalence.length; } patch_writer->SetRawDeltaSink(std::move(raw_delta_sink)); return true; } -bool GenerateRawElement(std::vector<offset_t> old_sa, +bool GenerateRawElement(const std::vector<offset_t>& old_sa, ConstBufferView old_image, ConstBufferView new_image, PatchElementWriter* patch_writer) { @@ -94,6 +152,8 @@ patch_writer); } +/******** Exported Functions ********/ + status::Code GenerateEnsemble(ConstBufferView old_image, ConstBufferView new_image, EnsemblePatchWriter* patch_writer) {
diff --git a/chrome/installer/zucchini/zucchini_gen.h b/chrome/installer/zucchini/zucchini_gen.h index 6c09221..42ff5ae 100644 --- a/chrome/installer/zucchini/zucchini_gen.h +++ b/chrome/installer/zucchini/zucchini_gen.h
@@ -7,6 +7,7 @@ #include <vector> +#include "chrome/installer/zucchini/buffer_view.h" #include "chrome/installer/zucchini/image_utils.h" #include "chrome/installer/zucchini/zucchini.h" @@ -16,6 +17,22 @@ class ImageIndex; class PatchElementWriter; +// Projects targets in |old_targets| to a list of new targets using +// |equivalences|. Targets that cannot be projected have offset assigned as +// |kUnusedIndex|. Returns the list of new targets in a new vector. +// |old_targets| must be sorted in ascending order and |equivalence| must be +// sorted in ascending order of |Equivalence::src_offset|. +std::vector<offset_t> MakeNewTargetsFromEquivalenceMap( + const std::vector<offset_t>& old_targets, + const std::vector<Equivalence>& equivalences); + +// Extracts all unmarked targets of references in |new_references| whose +// location is found in an equivalence of |equivalences|, and returns these +// targets in a new vector. |new_references| must be sorted in ascending order. +std::vector<offset_t> FindExtraTargets( + const std::vector<Reference>& new_references, + const EquivalenceMap& equivalences); + // Writes equivalences from |equivalence_map|, and extra data from |new_image| // found in gaps between equivalences to |patch_writer|. bool GenerateEquivalencesAndExtraData(ConstBufferView new_image, @@ -23,17 +40,17 @@ PatchElementWriter* patch_writer); // Writes raw delta between |old_image| and |new_image| matched by -// |equivalence_map| to |patch_writer|, using |new_index| to ignore reference -// bytes. +// |equivalence_map| to |patch_writer|, using |new_image_index| to ignore +// reference bytes. bool GenerateRawDelta(ConstBufferView old_image, ConstBufferView new_image, const EquivalenceMap& equivalence_map, - const ImageIndex& new_index, + const ImageIndex& new_image_index, PatchElementWriter* patch_writer); // Generates raw patch element data between |old_image| and |new_image|, and // writes them to |patch_writer|. |old_sa| is the suffix array for |old_image|. -bool GenerateRawElement(std::vector<offset_t> old_sa, +bool GenerateRawElement(const std::vector<offset_t>& old_sa, ConstBufferView old_image, ConstBufferView new_image, PatchElementWriter* patch_writer);
diff --git a/chrome/installer/zucchini/zucchini_gen_unittest.cc b/chrome/installer/zucchini/zucchini_gen_unittest.cc new file mode 100644 index 0000000..4ec353f2 --- /dev/null +++ b/chrome/installer/zucchini/zucchini_gen_unittest.cc
@@ -0,0 +1,91 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/installer/zucchini/zucchini_gen.h" + +#include <vector> + +#include "chrome/installer/zucchini/equivalence_map.h" +#include "chrome/installer/zucchini/image_utils.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace zucchini { + +namespace { + +constexpr auto BAD = kUnusedIndex; +using OffsetVector = std::vector<offset_t>; + +} // namespace + +TEST(ZucchiniGenTest, MakeNewTargetsFromEquivalenceMap) { + // Note that |old_offsets| provided are sorted, and |equivalences| provided + // are sorted by |src_offset|. + + EXPECT_EQ(OffsetVector(), MakeNewTargetsFromEquivalenceMap({}, {})); + EXPECT_EQ(OffsetVector({BAD, BAD}), + MakeNewTargetsFromEquivalenceMap({0, 1}, {})); + + EXPECT_EQ(OffsetVector({0, 1, BAD}), + MakeNewTargetsFromEquivalenceMap({0, 1, 2}, {{0, 0, 2}})); + EXPECT_EQ(OffsetVector({1, 2, BAD}), + MakeNewTargetsFromEquivalenceMap({0, 1, 2}, {{0, 1, 2}})); + EXPECT_EQ(OffsetVector({1, BAD, 4, 5, 6, BAD}), + MakeNewTargetsFromEquivalenceMap({0, 1, 2, 3, 4, 5}, + {{0, 1, 1}, {2, 4, 3}})); + EXPECT_EQ(OffsetVector({3, BAD, 0, 1, 2, BAD}), + MakeNewTargetsFromEquivalenceMap({0, 1, 2, 3, 4, 5}, + {{0, 3, 1}, {2, 0, 3}})); + + // Overlap in src. + EXPECT_EQ(OffsetVector({1, 2, 3, BAD, BAD}), + MakeNewTargetsFromEquivalenceMap({0, 1, 2, 3, 4}, + {{0, 1, 3}, {1, 4, 2}})); + EXPECT_EQ(OffsetVector({1, 4, 5, 6, BAD}), + MakeNewTargetsFromEquivalenceMap({0, 1, 2, 3, 4}, + {{0, 1, 2}, {1, 4, 3}})); + EXPECT_EQ(OffsetVector({1, 2, 5, BAD, BAD}), + MakeNewTargetsFromEquivalenceMap({0, 1, 2, 3, 4}, + {{0, 1, 2}, {1, 4, 2}})); + + // Jump in src. + EXPECT_EQ(OffsetVector({5, BAD, 6}), + MakeNewTargetsFromEquivalenceMap( + {10, 13, 15}, {{0, 1, 2}, {9, 4, 2}, {15, 6, 2}})); +} + +TEST(ZucchiniGenTest, FindExtraTargets) { + // Note that |new_offsets| provided are sorted, and |equivalences| provided + // are sorted by |dst_offset|. + + EXPECT_EQ(OffsetVector(), FindExtraTargets({}, {})); + EXPECT_EQ(OffsetVector(), FindExtraTargets({{0, 0}}, {})); + EXPECT_EQ(OffsetVector(), FindExtraTargets({{0, IsMarked(0)}}, {})); + + EXPECT_EQ(OffsetVector({0}), + FindExtraTargets({{0, 0}}, EquivalenceMap({{{0, 0, 2}, 0.0}}))); + EXPECT_EQ(OffsetVector(), + FindExtraTargets({{0, MarkIndex(0)}}, + EquivalenceMap({{{0, 0, 2}, 0.0}}))); + + EXPECT_EQ(OffsetVector({1, 2}), + FindExtraTargets({{0, 0}, {1, 1}, {2, 2}, {3, 3}}, + EquivalenceMap({{{0, 1, 2}, 0.0}}))); + EXPECT_EQ(OffsetVector({2}), + FindExtraTargets({{0, 0}, {1, MarkIndex(1)}, {2, 2}, {3, 3}}, + EquivalenceMap({{{0, 1, 2}, 0.0}}))); + + EXPECT_EQ( + OffsetVector({1, 2, 4, 5}), + FindExtraTargets({{0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}}, + EquivalenceMap({{{0, 1, 2}, 0.0}, {{0, 4, 2}, 0.0}}))); + EXPECT_EQ( + OffsetVector({4, 5}), + FindExtraTargets({{3, 3}, {4, 4}, {5, 5}, {6, 6}}, + EquivalenceMap({{{0, 1, 2}, 0.0}, {{0, 4, 2}, 0.0}}))); +} + +// TODO(huangs): Add more tests. + +} // namespace zucchini
diff --git a/chrome/profiling/memlog_connection_manager.cc b/chrome/profiling/memlog_connection_manager.cc index ce3f9ba..3e77c36 100644 --- a/chrome/profiling/memlog_connection_manager.cc +++ b/chrome/profiling/memlog_connection_manager.cc
@@ -20,7 +20,8 @@ BacktraceStorage* backtrace_storage, base::ProcessId pid, scoped_refptr<MemlogReceiverPipe> p) - : thread(base::StringPrintf("Sender %d thread", pid)), + : thread(base::StringPrintf("Sender %lld thread", + static_cast<long long>(pid))), pipe(p), tracker(std::move(complete_cb), backtrace_storage) {}
diff --git a/chrome/profiling/memlog_impl.cc b/chrome/profiling/memlog_impl.cc index cc772e8..174ef51 100644 --- a/chrome/profiling/memlog_impl.cc +++ b/chrome/profiling/memlog_impl.cc
@@ -23,7 +23,8 @@ MemlogImpl::~MemlogImpl() {} void MemlogImpl::AddSender(base::ProcessId pid, - mojo::ScopedHandle sender_pipe) { + mojo::ScopedHandle sender_pipe, + AddSenderCallback callback) { base::PlatformFile platform_file; CHECK_EQ(MOJO_RESULT_OK, mojo::UnwrapPlatformFile(std::move(sender_pipe), &platform_file)); @@ -34,6 +35,8 @@ FROM_HERE, base::BindOnce(&MemlogConnectionManager::OnNewConnection, base::Unretained(connection_manager_.get()), base::ScopedPlatformFile(platform_file), pid)); + + std::move(callback).Run(); } void MemlogImpl::DumpProcess(base::ProcessId pid,
diff --git a/chrome/profiling/memlog_impl.h b/chrome/profiling/memlog_impl.h index 4a8d8919..d600670 100644 --- a/chrome/profiling/memlog_impl.h +++ b/chrome/profiling/memlog_impl.h
@@ -30,7 +30,9 @@ MemlogImpl(); ~MemlogImpl() override; - void AddSender(base::ProcessId pid, mojo::ScopedHandle sender_pipe) override; + void AddSender(base::ProcessId pid, + mojo::ScopedHandle sender_pipe, + AddSenderCallback callback) override; void DumpProcess(base::ProcessId pid, mojo::ScopedHandle output_file) override;
diff --git a/chrome/profiling/memlog_receiver_pipe_posix.cc b/chrome/profiling/memlog_receiver_pipe_posix.cc index 3171685e..4d7323e 100644 --- a/chrome/profiling/memlog_receiver_pipe_posix.cc +++ b/chrome/profiling/memlog_receiver_pipe_posix.cc
@@ -50,7 +50,7 @@ void MemlogReceiverPipe::OnFileCanReadWithoutBlocking(int fd) { ssize_t bytes_read = 0; do { - std::deque<mojo::edk::PlatformHandle> dummy_for_receive; + base::circular_deque<mojo::edk::PlatformHandle> dummy_for_receive; bytes_read = mojo::edk::PlatformChannelRecvmsg( handle_.get(), read_buffer_.get(), kReadBufferSize, &dummy_for_receive); if (bytes_read > 0) {
diff --git a/chrome/renderer/resources/extensions/automation/automation_node.js b/chrome/renderer/resources/extensions/automation/automation_node.js index b994844..8098bb8 100644 --- a/chrome/renderer/resources/extensions/automation/automation_node.js +++ b/chrome/renderer/resources/extensions/automation/automation_node.js
@@ -284,7 +284,6 @@ */ var GetCustomActions = natives.GetCustomActions; -var lastError = require('lastError'); var logging = requireNative('logging'); var utils = require('utils');
diff --git a/chrome/renderer/resources/extensions/automation_custom_bindings.js b/chrome/renderer/resources/extensions/automation_custom_bindings.js index 1038fd3..f901aec 100644 --- a/chrome/renderer/resources/extensions/automation_custom_bindings.js +++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js
@@ -8,10 +8,7 @@ var automation = require('binding').Binding.create('automation'); var automationInternal = require('binding').Binding.create('automationInternal').generate(); -var eventBindings = require('event_bindings'); -var Event = eventBindings.Event; var exceptionHandler = require('uncaught_exception_handler'); -var forEach = require('utils').forEach; var lastError = require('lastError'); var logging = requireNative('logging'); var nativeAutomationInternal = requireNative('automationInternal');
diff --git a/chrome/renderer/resources/extensions/developer_private_custom_bindings.js b/chrome/renderer/resources/extensions/developer_private_custom_bindings.js index 66cc96d..6ad77d12 100644 --- a/chrome/renderer/resources/extensions/developer_private_custom_bindings.js +++ b/chrome/renderer/resources/extensions/developer_private_custom_bindings.js
@@ -4,7 +4,8 @@ // Custom binding for the developerPrivate API. -var binding = require('binding').Binding.create('developerPrivate'); +var binding = + apiBridge || require('binding').Binding.create('developerPrivate'); binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; @@ -60,4 +61,5 @@ }); }); -exports.$set('binding', binding.generate()); +if (!apiBridge) + exports.$set('binding', binding.generate());
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 7caea02..8360ae5 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2672,6 +2672,9 @@ "../browser/extensions/api/display_source/display_source_wifi_display_apitest.cc", ] } + if (!is_chromeos) { + sources += [ "../browser/ui/views/message_center/web_notification_tray_browsertest.cc" ] + } } if (is_chromeos || (is_linux && use_dbus)) {
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/ContentSuggestionsTestUtils.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/ContentSuggestionsTestUtils.java index 557ba7a..dd2716d 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/ContentSuggestionsTestUtils.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/suggestions/ContentSuggestionsTestUtils.java
@@ -194,7 +194,7 @@ @Override public void visitTileGrid() { - describeItem("TILE_GRID"); + describeItem("SITE_SECTION"); } private void describeItem(String description) {
diff --git a/chrome/test/data/autofill/heuristics/input/147_panera.custhelp.com_app_ask.html b/chrome/test/data/autofill/heuristics/input/147_panera.custhelp.com_app_ask.html new file mode 100644 index 0000000..5d5b51e --- /dev/null +++ b/chrome/test/data/autofill/heuristics/input/147_panera.custhelp.com_app_ask.html
@@ -0,0 +1,1398 @@ +<!DOCTYPE html> +<html lang="en-US"> +<head> + <meta charset="utf-8"/> + <title>Ask a Question</title> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> + <!--[if lt IE 9]><script src="/euf/core/static/html5.js"></script><![endif]--> + +<style type='text/css'> + <!-- +.rn_ScreenReaderOnly{position:absolute; height:1px; left:-10000px; overflow:hidden; top:auto; width:1px;} +.rn_Hidden{display:none !important;} + --></style> +<base href='https://panera.custhelp.com/euf/generated/optimized/1500491352/themes/standard/'/> +<link href='/euf/generated/optimized/1500491352/templates/standard.themes.standard.SITE.css' rel='stylesheet' type='text/css' media='all'/> +<style type="text/css"> +<!-- +.rn_CapabilityDetector .MessageContainer{font-size: 1.5em;line-height: 1em;padding: 10px;text-align: center;border-style: solid;border-width: 2px;} +.rn_KeywordText label{height: 1px;left: -10000px;overflow: hidden;position: absolute;top: auto;width: 1px;} +.rn_KeywordText input::-webkit-input-placeholder{color: #737373;} +.rn_KeywordText input::-moz-placeholder{color: #737373;opacity: 1;} +.rn_KeywordText input:-ms-input-placeholder{color: #737373;} +--> +</style> +<link href='/euf/generated/optimized/1500491352/pages/ask.themes.standard.css' rel='stylesheet' type='text/css' media='all'/> + + <link rel="icon" href="/euf/assets/images/favicon.ico" type="image/png"/> + <script type="text/javascript"> +<!-- +if (parent !== self) { + top.location.href = location.href; +} +else if (top !== self) { + top.location.href = self.document.location; +} +//--> +</script> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta name="google-site-verification" content="G_0B8ro_8RvjwKqBNVfa1e3xpiir5Fy-fbWZKd-8I3s" /> + <meta name="robots" content="noindex, nofollow"> + </head> +<body class="yui-skin-sam yui3-skin-sam" itemscope itemtype="http://schema.org/WebPage"> +<div class='rn_WidthLimit'> +<a href="#rn_MainContent" class="rn_SkipNav rn_ScreenReaderOnly">Skip Navigation</a> +<header class='pn_Header'> + <div class="rn_CapabilityDetector" id="rn_CapabilityDetector_2"> + <noscript> + <div class="MessageContainer MessageContainerFailure"> + Your browser either does not have JavaScript enabled or does not appear to support enough features of JavaScript to be used well on this site. </div> + </noscript> + <div id="rn_CapabilityDetector_2_MessageContainer"> + </div> + <script type="text/javascript"><!-- + /*<![CDATA[*/(function () { + var runJSTests = function() { + var messageContainerDiv = document.getElementById('rn_CapabilityDetector_2_MessageContainer'); + function showFailure() { + messageContainerDiv.className = 'MessageContainer MessageContainerFailure'; + messageContainerDiv.innerHTML = 'Your browser either does not have JavaScript enabled or does not appear to support enough features of JavaScript to be used well on this site.'; + } + function xhrTestFails() { + return !window.XMLHttpRequest; + } + if(typeof RightNowTesting !== 'undefined' && RightNowTesting._isTesting) { + RightNowTesting._xhrTestFails = xhrTestFails; + } + if (xhrTestFails()) { + showFailure(); + return; + } + } + if(typeof RightNowTesting !== 'undefined' && RightNowTesting._isTesting) { + RightNowTesting._runJSTests = runJSTests; + } + runJSTests(); +})(); + /*]]>*/ // --></script></div> + <a href='/'> + <div class='pn_Logo'> + <img src='images/panera/logo.png'/> + </div> + </a> + <h1 class='pn_CustomerCareHeader'> + <a href='/'>Customer Care Center</a> + </h1> +</header> +<div class="rn_Body"> + </div> + <div class="pn_SearchContainer"> + <div class="pn_SearchHeaderContainer"> + <h1>Ask Us Any Question</h1> + </div> + <div class="rn_SearchControls"> + <h1 class="rn_ScreenReaderOnly">Search</h1> + <form onsubmit="return false;"> + <div class="rn_SearchInput"> + <div id="rn_KeywordText_3" class="rn_KeywordText"> + <label for="rn_KeywordText_3_Text">Search by Keyword</label> + <input placeholder="Search for answers" id="rn_KeywordText_3_Text" name="rn_KeywordText_3_Text" type="text" maxlength="255" value=""/> +</div> + </div> + <div id="rn_SearchButton_4" class="rn_SearchButton"> + <button type="submit" class="rn_SubmitButton" id="rn_SearchButton_4_SubmitButton"> + <span class="rn_ButtonText">Search</span> + </button> + </div> + </form> + </div> + </div> + <div class='pn_Divider pn_HideMediumUp'></div> + <div class="rn_MainColumn" role="main"> + <a id="rn_MainContent"></a> +<div class='pn_PageTitle'> + <h1>Email Us</h1> + <span>Our Customer Care Team will reply as soon as possible</span> +</div> +<div class="rn_PageContent rn_AskQuestion rn_Container"> + <form id="rn_QuestionSubmit" method="post" action="/ci/ajaxRequest/sendForm"> + <div id="rn_ErrorLocation"></div> + <div class='rn_Hidden'> + <div id="rn_SelectionInput_7" class="rn_SelectionInput rn_Input rn_Radio"> + <fieldset> + <legend id="rn_SelectionInput_7_Label" class="rn_Label"> + Escalated Gift Card - Devalue </legend> + <input type="radio" name="Incident.CustomFields.c.escalated_gift_card_devalue" id="rn_SelectionInput_7_Incident.CustomFields.c.escalated_gift_card_devalue_1" value="1"/> + <label for="rn_SelectionInput_7_Incident.CustomFields.c.escalated_gift_card_devalue_1"> + Yes </label> + <input type="radio" name="Incident.CustomFields.c.escalated_gift_card_devalue" id="rn_SelectionInput_7_Incident.CustomFields.c.escalated_gift_card_devalue_0" value="0"/> + <label for="rn_SelectionInput_7_Incident.CustomFields.c.escalated_gift_card_devalue_0"> + No </label> + </fieldset> + </div> + <div id="rn_SelectionInput_9" class="rn_SelectionInput rn_Input rn_Radio"> + <fieldset> + <legend id="rn_SelectionInput_9_Label" class="rn_Label"> + Escalated - Catering Sales </legend> + <input type="radio" name="Incident.CustomFields.c.escalated_catering_sales" id="rn_SelectionInput_9_Incident.CustomFields.c.escalated_catering_sales_1" value="1"/> + <label for="rn_SelectionInput_9_Incident.CustomFields.c.escalated_catering_sales_1"> + Yes </label> + <input type="radio" name="Incident.CustomFields.c.escalated_catering_sales" id="rn_SelectionInput_9_Incident.CustomFields.c.escalated_catering_sales_0" value="0"/> + <label for="rn_SelectionInput_9_Incident.CustomFields.c.escalated_catering_sales_0"> + No </label> + </fieldset> + </div> + <div id="rn_DateInput_11" class="rn_DateInput rn_Input"> +<fieldset> + <legend id="rn_DateInput_11_Legend" class="rn_Label">PA Team Escalated Team Assign </legend> + <label for="rn_DateInput_11_Incident.CustomFields.c.pa_team_escalated_team_assign_Month" class="rn_ScreenReaderOnly">Month</label> + <select id="rn_DateInput_11_Incident.CustomFields.c.pa_team_escalated_team_assign_Month" name="Incident.CustomFields.c.pa_team_escalated_team_assign.month"> + <option value=''>--</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + </select> + <label for="rn_DateInput_11_Incident.CustomFields.c.pa_team_escalated_team_assign_Day" class="rn_ScreenReaderOnly">Day</label> + <select id="rn_DateInput_11_Incident.CustomFields.c.pa_team_escalated_team_assign_Day" name="Incident.CustomFields.c.pa_team_escalated_team_assign.day"> + <option value=''>--</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + <option value="13" >13</option> + <option value="14" >14</option> + <option value="15" >15</option> + <option value="16" >16</option> + <option value="17" >17</option> + <option value="18" >18</option> + <option value="19" >19</option> + <option value="20" >20</option> + <option value="21" >21</option> + <option value="22" >22</option> + <option value="23" >23</option> + <option value="24" >24</option> + <option value="25" >25</option> + <option value="26" >26</option> + <option value="27" >27</option> + <option value="28" >28</option> + <option value="29" >29</option> + <option value="30" >30</option> + <option value="31" >31</option> + </select> + <label for="rn_DateInput_11_Incident.CustomFields.c.pa_team_escalated_team_assign_Year" class="rn_ScreenReaderOnly">Year</label> + <select id="rn_DateInput_11_Incident.CustomFields.c.pa_team_escalated_team_assign_Year" name="Incident.CustomFields.c.pa_team_escalated_team_assign.year"> + <option value=''>--</option> + <option value="2017" >2017</option> + <option value="2016" >2016</option> + <option value="2015" >2015</option> + <option value="2014" >2014</option> + <option value="2013" >2013</option> + <option value="2012" >2012</option> + <option value="2011" >2011</option> + <option value="2010" >2010</option> + <option value="2009" >2009</option> + <option value="2008" >2008</option> + <option value="2007" >2007</option> + <option value="2006" >2006</option> + <option value="2005" >2005</option> + <option value="2004" >2004</option> + <option value="2003" >2003</option> + <option value="2002" >2002</option> + <option value="2001" >2001</option> + <option value="2000" >2000</option> + <option value="1999" >1999</option> + <option value="1998" >1998</option> + <option value="1997" >1997</option> + <option value="1996" >1996</option> + <option value="1995" >1995</option> + <option value="1994" >1994</option> + <option value="1993" >1993</option> + <option value="1992" >1992</option> + <option value="1991" >1991</option> + <option value="1990" >1990</option> + <option value="1989" >1989</option> + <option value="1988" >1988</option> + <option value="1987" >1987</option> + <option value="1986" >1986</option> + <option value="1985" >1985</option> + <option value="1984" >1984</option> + <option value="1983" >1983</option> + <option value="1982" >1982</option> + <option value="1981" >1981</option> + <option value="1980" >1980</option> + <option value="1979" >1979</option> + <option value="1978" >1978</option> + <option value="1977" >1977</option> + <option value="1976" >1976</option> + <option value="1975" >1975</option> + <option value="1974" >1974</option> + <option value="1973" >1973</option> + <option value="1972" >1972</option> + <option value="1971" >1971</option> + <option value="1970" >1970</option> + </select> + <label for="rn_DateInput_11_Incident.CustomFields.c.pa_team_escalated_team_assign_Hour" class="rn_ScreenReaderOnly">Hour</label> + <select id="rn_DateInput_11_Incident.CustomFields.c.pa_team_escalated_team_assign_Hour" name="Incident.CustomFields.c.pa_team_escalated_team_assign.hour"> + <option value=''>--</option> + <option value="0" >0</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + <option value="13" >13</option> + <option value="14" >14</option> + <option value="15" >15</option> + <option value="16" >16</option> + <option value="17" >17</option> + <option value="18" >18</option> + <option value="19" >19</option> + <option value="20" >20</option> + <option value="21" >21</option> + <option value="22" >22</option> + <option value="23" >23</option> + </select> + <label for="rn_DateInput_11_Incident.CustomFields.c.pa_team_escalated_team_assign_Minute" class="rn_ScreenReaderOnly">Minute</label> + <select id="rn_DateInput_11_Incident.CustomFields.c.pa_team_escalated_team_assign_Minute" name="Incident.CustomFields.c.pa_team_escalated_team_assign.minute"> + <option value=''>--</option> + <option value="0" >0</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + <option value="13" >13</option> + <option value="14" >14</option> + <option value="15" >15</option> + <option value="16" >16</option> + <option value="17" >17</option> + <option value="18" >18</option> + <option value="19" >19</option> + <option value="20" >20</option> + <option value="21" >21</option> + <option value="22" >22</option> + <option value="23" >23</option> + <option value="24" >24</option> + <option value="25" >25</option> + <option value="26" >26</option> + <option value="27" >27</option> + <option value="28" >28</option> + <option value="29" >29</option> + <option value="30" >30</option> + <option value="31" >31</option> + <option value="32" >32</option> + <option value="33" >33</option> + <option value="34" >34</option> + <option value="35" >35</option> + <option value="36" >36</option> + <option value="37" >37</option> + <option value="38" >38</option> + <option value="39" >39</option> + <option value="40" >40</option> + <option value="41" >41</option> + <option value="42" >42</option> + <option value="43" >43</option> + <option value="44" >44</option> + <option value="45" >45</option> + <option value="46" >46</option> + <option value="47" >47</option> + <option value="48" >48</option> + <option value="49" >49</option> + <option value="50" >50</option> + <option value="51" >51</option> + <option value="52" >52</option> + <option value="53" >53</option> + <option value="54" >54</option> + <option value="55" >55</option> + <option value="56" >56</option> + <option value="57" >57</option> + <option value="58" >58</option> + <option value="59" >59</option> + </select> +</fieldset> +</div> + <div id="rn_DateInput_13" class="rn_DateInput rn_Input"> +<fieldset> + <legend id="rn_DateInput_13_Legend" class="rn_Label">PA Team Initial Tracking </legend> + <label for="rn_DateInput_13_Incident.CustomFields.c.pa_team_initial_tracking_Month" class="rn_ScreenReaderOnly">Month</label> + <select id="rn_DateInput_13_Incident.CustomFields.c.pa_team_initial_tracking_Month" name="Incident.CustomFields.c.pa_team_initial_tracking.month"> + <option value=''>--</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + </select> + <label for="rn_DateInput_13_Incident.CustomFields.c.pa_team_initial_tracking_Day" class="rn_ScreenReaderOnly">Day</label> + <select id="rn_DateInput_13_Incident.CustomFields.c.pa_team_initial_tracking_Day" name="Incident.CustomFields.c.pa_team_initial_tracking.day"> + <option value=''>--</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + <option value="13" >13</option> + <option value="14" >14</option> + <option value="15" >15</option> + <option value="16" >16</option> + <option value="17" >17</option> + <option value="18" >18</option> + <option value="19" >19</option> + <option value="20" >20</option> + <option value="21" >21</option> + <option value="22" >22</option> + <option value="23" >23</option> + <option value="24" >24</option> + <option value="25" >25</option> + <option value="26" >26</option> + <option value="27" >27</option> + <option value="28" >28</option> + <option value="29" >29</option> + <option value="30" >30</option> + <option value="31" >31</option> + </select> + <label for="rn_DateInput_13_Incident.CustomFields.c.pa_team_initial_tracking_Year" class="rn_ScreenReaderOnly">Year</label> + <select id="rn_DateInput_13_Incident.CustomFields.c.pa_team_initial_tracking_Year" name="Incident.CustomFields.c.pa_team_initial_tracking.year"> + <option value=''>--</option> + <option value="2017" >2017</option> + <option value="2016" >2016</option> + <option value="2015" >2015</option> + <option value="2014" >2014</option> + <option value="2013" >2013</option> + <option value="2012" >2012</option> + <option value="2011" >2011</option> + <option value="2010" >2010</option> + <option value="2009" >2009</option> + <option value="2008" >2008</option> + <option value="2007" >2007</option> + <option value="2006" >2006</option> + <option value="2005" >2005</option> + <option value="2004" >2004</option> + <option value="2003" >2003</option> + <option value="2002" >2002</option> + <option value="2001" >2001</option> + <option value="2000" >2000</option> + <option value="1999" >1999</option> + <option value="1998" >1998</option> + <option value="1997" >1997</option> + <option value="1996" >1996</option> + <option value="1995" >1995</option> + <option value="1994" >1994</option> + <option value="1993" >1993</option> + <option value="1992" >1992</option> + <option value="1991" >1991</option> + <option value="1990" >1990</option> + <option value="1989" >1989</option> + <option value="1988" >1988</option> + <option value="1987" >1987</option> + <option value="1986" >1986</option> + <option value="1985" >1985</option> + <option value="1984" >1984</option> + <option value="1983" >1983</option> + <option value="1982" >1982</option> + <option value="1981" >1981</option> + <option value="1980" >1980</option> + <option value="1979" >1979</option> + <option value="1978" >1978</option> + <option value="1977" >1977</option> + <option value="1976" >1976</option> + <option value="1975" >1975</option> + <option value="1974" >1974</option> + <option value="1973" >1973</option> + <option value="1972" >1972</option> + <option value="1971" >1971</option> + <option value="1970" >1970</option> + </select> + <label for="rn_DateInput_13_Incident.CustomFields.c.pa_team_initial_tracking_Hour" class="rn_ScreenReaderOnly">Hour</label> + <select id="rn_DateInput_13_Incident.CustomFields.c.pa_team_initial_tracking_Hour" name="Incident.CustomFields.c.pa_team_initial_tracking.hour"> + <option value=''>--</option> + <option value="0" >0</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + <option value="13" >13</option> + <option value="14" >14</option> + <option value="15" >15</option> + <option value="16" >16</option> + <option value="17" >17</option> + <option value="18" >18</option> + <option value="19" >19</option> + <option value="20" >20</option> + <option value="21" >21</option> + <option value="22" >22</option> + <option value="23" >23</option> + </select> + <label for="rn_DateInput_13_Incident.CustomFields.c.pa_team_initial_tracking_Minute" class="rn_ScreenReaderOnly">Minute</label> + <select id="rn_DateInput_13_Incident.CustomFields.c.pa_team_initial_tracking_Minute" name="Incident.CustomFields.c.pa_team_initial_tracking.minute"> + <option value=''>--</option> + <option value="0" >0</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + <option value="13" >13</option> + <option value="14" >14</option> + <option value="15" >15</option> + <option value="16" >16</option> + <option value="17" >17</option> + <option value="18" >18</option> + <option value="19" >19</option> + <option value="20" >20</option> + <option value="21" >21</option> + <option value="22" >22</option> + <option value="23" >23</option> + <option value="24" >24</option> + <option value="25" >25</option> + <option value="26" >26</option> + <option value="27" >27</option> + <option value="28" >28</option> + <option value="29" >29</option> + <option value="30" >30</option> + <option value="31" >31</option> + <option value="32" >32</option> + <option value="33" >33</option> + <option value="34" >34</option> + <option value="35" >35</option> + <option value="36" >36</option> + <option value="37" >37</option> + <option value="38" >38</option> + <option value="39" >39</option> + <option value="40" >40</option> + <option value="41" >41</option> + <option value="42" >42</option> + <option value="43" >43</option> + <option value="44" >44</option> + <option value="45" >45</option> + <option value="46" >46</option> + <option value="47" >47</option> + <option value="48" >48</option> + <option value="49" >49</option> + <option value="50" >50</option> + <option value="51" >51</option> + <option value="52" >52</option> + <option value="53" >53</option> + <option value="54" >54</option> + <option value="55" >55</option> + <option value="56" >56</option> + <option value="57" >57</option> + <option value="58" >58</option> + <option value="59" >59</option> + </select> +</fieldset> +</div> + <div id="rn_DateInput_15" class="rn_DateInput rn_Input"> +<fieldset> + <legend id="rn_DateInput_15_Legend" class="rn_Label">PA Team Analyst Assignment </legend> + <label for="rn_DateInput_15_Incident.CustomFields.c.pa_team_analyst_assignment_Month" class="rn_ScreenReaderOnly">Month</label> + <select id="rn_DateInput_15_Incident.CustomFields.c.pa_team_analyst_assignment_Month" name="Incident.CustomFields.c.pa_team_analyst_assignment.month"> + <option value=''>--</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + </select> + <label for="rn_DateInput_15_Incident.CustomFields.c.pa_team_analyst_assignment_Day" class="rn_ScreenReaderOnly">Day</label> + <select id="rn_DateInput_15_Incident.CustomFields.c.pa_team_analyst_assignment_Day" name="Incident.CustomFields.c.pa_team_analyst_assignment.day"> + <option value=''>--</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + <option value="13" >13</option> + <option value="14" >14</option> + <option value="15" >15</option> + <option value="16" >16</option> + <option value="17" >17</option> + <option value="18" >18</option> + <option value="19" >19</option> + <option value="20" >20</option> + <option value="21" >21</option> + <option value="22" >22</option> + <option value="23" >23</option> + <option value="24" >24</option> + <option value="25" >25</option> + <option value="26" >26</option> + <option value="27" >27</option> + <option value="28" >28</option> + <option value="29" >29</option> + <option value="30" >30</option> + <option value="31" >31</option> + </select> + <label for="rn_DateInput_15_Incident.CustomFields.c.pa_team_analyst_assignment_Year" class="rn_ScreenReaderOnly">Year</label> + <select id="rn_DateInput_15_Incident.CustomFields.c.pa_team_analyst_assignment_Year" name="Incident.CustomFields.c.pa_team_analyst_assignment.year"> + <option value=''>--</option> + <option value="2017" >2017</option> + <option value="2016" >2016</option> + <option value="2015" >2015</option> + <option value="2014" >2014</option> + <option value="2013" >2013</option> + <option value="2012" >2012</option> + <option value="2011" >2011</option> + <option value="2010" >2010</option> + <option value="2009" >2009</option> + <option value="2008" >2008</option> + <option value="2007" >2007</option> + <option value="2006" >2006</option> + <option value="2005" >2005</option> + <option value="2004" >2004</option> + <option value="2003" >2003</option> + <option value="2002" >2002</option> + <option value="2001" >2001</option> + <option value="2000" >2000</option> + <option value="1999" >1999</option> + <option value="1998" >1998</option> + <option value="1997" >1997</option> + <option value="1996" >1996</option> + <option value="1995" >1995</option> + <option value="1994" >1994</option> + <option value="1993" >1993</option> + <option value="1992" >1992</option> + <option value="1991" >1991</option> + <option value="1990" >1990</option> + <option value="1989" >1989</option> + <option value="1988" >1988</option> + <option value="1987" >1987</option> + <option value="1986" >1986</option> + <option value="1985" >1985</option> + <option value="1984" >1984</option> + <option value="1983" >1983</option> + <option value="1982" >1982</option> + <option value="1981" >1981</option> + <option value="1980" >1980</option> + <option value="1979" >1979</option> + <option value="1978" >1978</option> + <option value="1977" >1977</option> + <option value="1976" >1976</option> + <option value="1975" >1975</option> + <option value="1974" >1974</option> + <option value="1973" >1973</option> + <option value="1972" >1972</option> + <option value="1971" >1971</option> + <option value="1970" >1970</option> + </select> + <label for="rn_DateInput_15_Incident.CustomFields.c.pa_team_analyst_assignment_Hour" class="rn_ScreenReaderOnly">Hour</label> + <select id="rn_DateInput_15_Incident.CustomFields.c.pa_team_analyst_assignment_Hour" name="Incident.CustomFields.c.pa_team_analyst_assignment.hour"> + <option value=''>--</option> + <option value="0" >0</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + <option value="13" >13</option> + <option value="14" >14</option> + <option value="15" >15</option> + <option value="16" >16</option> + <option value="17" >17</option> + <option value="18" >18</option> + <option value="19" >19</option> + <option value="20" >20</option> + <option value="21" >21</option> + <option value="22" >22</option> + <option value="23" >23</option> + </select> + <label for="rn_DateInput_15_Incident.CustomFields.c.pa_team_analyst_assignment_Minute" class="rn_ScreenReaderOnly">Minute</label> + <select id="rn_DateInput_15_Incident.CustomFields.c.pa_team_analyst_assignment_Minute" name="Incident.CustomFields.c.pa_team_analyst_assignment.minute"> + <option value=''>--</option> + <option value="0" >0</option> + <option value="1" >1</option> + <option value="2" >2</option> + <option value="3" >3</option> + <option value="4" >4</option> + <option value="5" >5</option> + <option value="6" >6</option> + <option value="7" >7</option> + <option value="8" >8</option> + <option value="9" >9</option> + <option value="10" >10</option> + <option value="11" >11</option> + <option value="12" >12</option> + <option value="13" >13</option> + <option value="14" >14</option> + <option value="15" >15</option> + <option value="16" >16</option> + <option value="17" >17</option> + <option value="18" >18</option> + <option value="19" >19</option> + <option value="20" >20</option> + <option value="21" >21</option> + <option value="22" >22</option> + <option value="23" >23</option> + <option value="24" >24</option> + <option value="25" >25</option> + <option value="26" >26</option> + <option value="27" >27</option> + <option value="28" >28</option> + <option value="29" >29</option> + <option value="30" >30</option> + <option value="31" >31</option> + <option value="32" >32</option> + <option value="33" >33</option> + <option value="34" >34</option> + <option value="35" >35</option> + <option value="36" >36</option> + <option value="37" >37</option> + <option value="38" >38</option> + <option value="39" >39</option> + <option value="40" >40</option> + <option value="41" >41</option> + <option value="42" >42</option> + <option value="43" >43</option> + <option value="44" >44</option> + <option value="45" >45</option> + <option value="46" >46</option> + <option value="47" >47</option> + <option value="48" >48</option> + <option value="49" >49</option> + <option value="50" >50</option> + <option value="51" >51</option> + <option value="52" >52</option> + <option value="53" >53</option> + <option value="54" >54</option> + <option value="55" >55</option> + <option value="56" >56</option> + <option value="57" >57</option> + <option value="58" >58</option> + <option value="59" >59</option> + </select> +</fieldset> +</div> + <div id="rn_TextInput_17" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_17_LabelContainer"> + <label for="rn_TextInput_17_Incident.CustomFields.c.pa_external_reference_nbr" id="rn_TextInput_17_Label" class="rn_Label"> + PA External Reference <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_17_Incident.CustomFields.c.pa_external_reference_nbr" name="Incident.CustomFields.c.pa_external_reference_nbr" class="rn_Text" maxlength='20' placeholder=" "/> + </div> + <div id="rn_SelectionInput_19" class="rn_SelectionInput rn_Input rn_Radio"> + <fieldset> + <legend id="rn_SelectionInput_19_Label" class="rn_Label"> + PA Tracking Monitor Control </legend> + <input type="radio" name="Incident.CustomFields.c.pa_tracking_monitor_control" id="rn_SelectionInput_19_Incident.CustomFields.c.pa_tracking_monitor_control_1" value="1"/> + <label for="rn_SelectionInput_19_Incident.CustomFields.c.pa_tracking_monitor_control_1"> + Yes </label> + <input type="radio" name="Incident.CustomFields.c.pa_tracking_monitor_control" id="rn_SelectionInput_19_Incident.CustomFields.c.pa_tracking_monitor_control_0" checked="checked" value="0"/> + <label for="rn_SelectionInput_19_Incident.CustomFields.c.pa_tracking_monitor_control_0"> + No </label> + </fieldset> + </div> + <div id="rn_SelectionInput_21" class="rn_SelectionInput rn_Input rn_Radio"> + <fieldset> + <legend id="rn_SelectionInput_21_Label" class="rn_Label"> + Gift Card Agent </legend> + <input type="radio" name="Incident.CustomFields.c.gift_card_super_agent" id="rn_SelectionInput_21_Incident.CustomFields.c.gift_card_super_agent_1" value="1"/> + <label for="rn_SelectionInput_21_Incident.CustomFields.c.gift_card_super_agent_1"> + Yes </label> + <input type="radio" name="Incident.CustomFields.c.gift_card_super_agent" id="rn_SelectionInput_21_Incident.CustomFields.c.gift_card_super_agent_0" value="0"/> + <label for="rn_SelectionInput_21_Incident.CustomFields.c.gift_card_super_agent_0"> + No </label> + </fieldset> + </div> + <div id="rn_SelectionInput_23" class="rn_SelectionInput rn_Input"> + <div id="rn_SelectionInput_23_LabelContainer"> + <label for="rn_SelectionInput_23_Incident.CustomFields.c.gift_card_request_type" id="rn_SelectionInput_23_Label" class="rn_Label">Gift Card Request Type </label> + </div> + <select id="rn_SelectionInput_23_Incident.CustomFields.c.gift_card_request_type" name="Incident.CustomFields.c.gift_card_request_type"> + <option value="">--</option> + <option value="591" >Frozen Card</option> + <option value="592" >Mag Swipe Restricted</option> + <option value="593" >Other</option> + </select> + </div> + <div id="rn_SelectionInput_25" class="rn_SelectionInput rn_Input"> + <div id="rn_SelectionInput_25_LabelContainer"> + <label for="rn_SelectionInput_25_Incident.CustomFields.c.gift_card_action" id="rn_SelectionInput_25_Label" class="rn_Label">Gift Card Action </label> + </div> + <select id="rn_SelectionInput_25_Incident.CustomFields.c.gift_card_action" name="Incident.CustomFields.c.gift_card_action"> + <option value="">--</option> + <option value="589" >Devalue</option> + <option value="590" >Add Value</option> + <option value="594" >Devalue and Add Value</option> + <option value="595" >Combine Cards</option> + </select> + </div> + <div id="rn_SelectionInput_27" class="rn_SelectionInput rn_Input"> + <div id="rn_SelectionInput_27_LabelContainer"> + <label for="rn_SelectionInput_27_Incident.CustomFields.c.gift_card_issuer_person" id="rn_SelectionInput_27_Label" class="rn_Label">Gift Card Issuer (person) </label> + </div> + <select id="rn_SelectionInput_27_Incident.CustomFields.c.gift_card_issuer_person" name="Incident.CustomFields.c.gift_card_issuer_person"> + <option value="">--</option> + <option value="588" selected="selected">Jane</option> + </select> + </div> + <div id="rn_TextInput_29" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_29_LabelContainer"> + <label for="rn_TextInput_29_Incident.CustomFields.c.gift_card_appeasement_amt" id="rn_TextInput_29_Label" class="rn_Label"> + Gift Card Appeasement $ <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_29_Incident.CustomFields.c.gift_card_appeasement_amt" name="Incident.CustomFields.c.gift_card_appeasement_amt" class="rn_Text" maxlength='10' placeholder=" "/> + </div> + <div id="rn_TextInput_31" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_31_LabelContainer"> + <label for="rn_TextInput_31_Incident.CustomFields.c.gift_card_amount_new" id="rn_TextInput_31_Label" class="rn_Label"> + Gift Card Amount (new) <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_31_Incident.CustomFields.c.gift_card_amount_new" name="Incident.CustomFields.c.gift_card_amount_new" class="rn_Text" maxlength='10' placeholder=" "/> + </div> + <div id="rn_TextInput_33" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_33_LabelContainer"> + <label for="rn_TextInput_33_Incident.CustomFields.c.gift_card_new_card" id="rn_TextInput_33_Label" class="rn_Label"> + Gift Card - New Card # <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_33_Incident.CustomFields.c.gift_card_new_card" name="Incident.CustomFields.c.gift_card_new_card" class="rn_Text" maxlength='19' placeholder=" "/> + </div> + <div id="rn_TextInput_35" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_35_LabelContainer"> + <label for="rn_TextInput_35_Incident.CustomFields.c.gift_card_box_number" id="rn_TextInput_35_Label" class="rn_Label"> + Gift Card Box # <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_35_Incident.CustomFields.c.gift_card_box_number" name="Incident.CustomFields.c.gift_card_box_number" class="rn_Text" maxlength='20' placeholder=" "/> + </div> + <div id="rn_TextInput_37" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_37_LabelContainer"> + <label for="rn_TextInput_37_Incident.CustomFields.c.gift_card_frozen_amount" id="rn_TextInput_37_Label" class="rn_Label"> + Gift Card Amount (frozen) <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_37_Incident.CustomFields.c.gift_card_frozen_amount" name="Incident.CustomFields.c.gift_card_frozen_amount" class="rn_Text" maxlength='10' placeholder=" "/> + </div> + <div id="rn_TextInput_39" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_39_LabelContainer"> + <label for="rn_TextInput_39_Incident.CustomFields.c.gift_card_frozen_card_number" id="rn_TextInput_39_Label" class="rn_Label"> + Gift Card Frozen Card # <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_39_Incident.CustomFields.c.gift_card_frozen_card_number" name="Incident.CustomFields.c.gift_card_frozen_card_number" class="rn_Text" maxlength='19' placeholder=" "/> + </div> + <div id="rn_TextInput_41" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_41_LabelContainer"> + <label for="rn_TextInput_41_Incident.CustomFields.c.gift_card_issuing_location" id="rn_TextInput_41_Label" class="rn_Label"> + Gift Card Issuing Location <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_41_Incident.CustomFields.c.gift_card_issuing_location" name="Incident.CustomFields.c.gift_card_issuing_location" class="rn_Text" maxlength='30' placeholder=" "/> + </div> + <div id="rn_SelectionInput_43" class="rn_SelectionInput rn_Input"> + <div id="rn_SelectionInput_43_LabelContainer"> + <label for="rn_SelectionInput_43_Incident.CustomFields.c.chat_type" id="rn_SelectionInput_43_Label" class="rn_Label">Chat Topic <span class="rn_ScreenReaderOnly">Please select the Chat topic that best fits the issue</span> + </label> + </div> + <select id="rn_SelectionInput_43_Incident.CustomFields.c.chat_type" name="Incident.CustomFields.c.chat_type"> + <option value="">--</option> + <option value="96" >Online Ordering Support</option> + <option value="308" >Catering Website Support</option> + <option value="309" >Account Support</option> + </select> + </div> + <div id="rn_TextInput_45" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_45_LabelContainer"> + <label for="rn_TextInput_45_Incident.CustomFields.c.last_4_digits" id="rn_TextInput_45_Label" class="rn_Label"> + last 4 digits <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + <span class="rn_ScreenReaderOnly">Enter the last 4 digits of the customer's credit card</span> + </label> + </div> + <input type="text" id="rn_TextInput_45_Incident.CustomFields.c.last_4_digits" name="Incident.CustomFields.c.last_4_digits" class="rn_Text" maxlength='4' placeholder=" "/> + </div> + <div id="rn_SelectionInput_47" class="rn_SelectionInput rn_Input rn_Radio"> + <fieldset> + <legend id="rn_SelectionInput_47_Label" class="rn_Label"> + Which location did you visit? </legend> + <input type="radio" name="Incident.CustomFields.c.pertains_to_cafe" id="rn_SelectionInput_47_Incident.CustomFields.c.pertains_to_cafe_1" value="1"/> + <label for="rn_SelectionInput_47_Incident.CustomFields.c.pertains_to_cafe_1"> + Yes <span class="rn_ScreenReaderOnly">Does your question or comment pertain to a specific bakery-cafe? If it does, please select this option so we can be sure we are addressing the correct bakery-cafe.</span> + </label> + <input type="radio" name="Incident.CustomFields.c.pertains_to_cafe" id="rn_SelectionInput_47_Incident.CustomFields.c.pertains_to_cafe_0" checked="checked" value="0"/> + <label for="rn_SelectionInput_47_Incident.CustomFields.c.pertains_to_cafe_0"> + No </label> + </fieldset> + </div> + <div id="rn_SelectionInput_49" class="rn_SelectionInput rn_Input rn_Radio"> + <fieldset> + <legend id="rn_SelectionInput_49_Label" class="rn_Label"> + Send to Franchise </legend> + <input type="radio" name="Incident.CustomFields.c.send_to_franchise" id="rn_SelectionInput_49_Incident.CustomFields.c.send_to_franchise_1" value="1"/> + <label for="rn_SelectionInput_49_Incident.CustomFields.c.send_to_franchise_1"> + Yes </label> + <input type="radio" name="Incident.CustomFields.c.send_to_franchise" id="rn_SelectionInput_49_Incident.CustomFields.c.send_to_franchise_0" value="0"/> + <label for="rn_SelectionInput_49_Incident.CustomFields.c.send_to_franchise_0"> + No </label> + </fieldset> + </div> + <div id="rn_SelectionInput_51" class="rn_SelectionInput rn_Input rn_Radio"> + <fieldset> + <legend id="rn_SelectionInput_51_Label" class="rn_Label"> + Order Cancellation </legend> + <input type="radio" name="Incident.CustomFields.c.order_cancellation" id="rn_SelectionInput_51_Incident.CustomFields.c.order_cancellation_1" value="1"/> + <label for="rn_SelectionInput_51_Incident.CustomFields.c.order_cancellation_1"> + Yes </label> + <input type="radio" name="Incident.CustomFields.c.order_cancellation" id="rn_SelectionInput_51_Incident.CustomFields.c.order_cancellation_0" value="0"/> + <label for="rn_SelectionInput_51_Incident.CustomFields.c.order_cancellation_0"> + No </label> + </fieldset> + </div> + <div id="rn_SelectionInput_53" class="rn_SelectionInput rn_Input"> + <div id="rn_SelectionInput_53_LabelContainer"> + <label for="rn_SelectionInput_53_Incident.CustomFields.c.admin_workspace_selection" id="rn_SelectionInput_53_Label" class="rn_Label">Workspace selection </label> + </div> + <select id="rn_SelectionInput_53_Incident.CustomFields.c.admin_workspace_selection" name="Incident.CustomFields.c.admin_workspace_selection"> + <option value="">--</option> + <option value="598" >Customer Care Standard Agent</option> + <option value="599" >Gift Card Specialist</option> + <option value="600" >Cafe ReDirect Specialist</option> + <option value="601" >Preventative Analysis</option> + <option value="602" >Program Management</option> + <option value="605" >prePROD Test Workspace</option> + </select> + </div> + <div id="rn_SelectionInput_55" class="rn_SelectionInput rn_Input"> + <div id="rn_SelectionInput_55_LabelContainer"> + <label for="rn_SelectionInput_55_Incident.CustomFields.c.esc_reasonforrefund" id="rn_SelectionInput_55_Label" class="rn_Label">Reason for Refund v2 <span class="rn_ScreenReaderOnly">Reason for providing the guest a refund.</span> + </label> + </div> + <select id="rn_SelectionInput_55_Incident.CustomFields.c.esc_reasonforrefund" name="Incident.CustomFields.c.esc_reasonforrefund"> + <option value="">--</option> + <option value="610" >Double Charged</option> + <option value="608" >eCommerce Issue</option> + <option value="611" >No Intended Sale</option> + <option value="613" >Removing Tax</option> + <option value="609" >Removing Tip</option> + <option value="612" >Service Issue</option> + </select> + </div> + <div id="rn_SelectionInput_57" class="rn_SelectionInput rn_Input"> + <div id="rn_SelectionInput_57_LabelContainer"> + <label for="rn_SelectionInput_57_Incident.CustomFields.c.esc_paymentmethod" id="rn_SelectionInput_57_Label" class="rn_Label">Payment Method </label> + </div> + <select id="rn_SelectionInput_57_Incident.CustomFields.c.esc_paymentmethod" name="Incident.CustomFields.c.esc_paymentmethod"> + <option value="">--</option> + <option value="628" >Android Pay</option> + <option value="626" >Apple Pay</option> + <option value="625" >Credit Card</option> + <option value="627" >PayPal</option> + </select> + </div> + <div id="rn_SelectionInput_59" class="rn_SelectionInput rn_Input rn_Radio"> + <fieldset> + <legend id="rn_SelectionInput_59_Label" class="rn_Label"> + Email Opt In </legend> + <input type="radio" name="Incident.CustomFields.c.email_opt_in" id="rn_SelectionInput_59_Incident.CustomFields.c.email_opt_in_1" value="1"/> + <label for="rn_SelectionInput_59_Incident.CustomFields.c.email_opt_in_1"> + Yes </label> + <input type="radio" name="Incident.CustomFields.c.email_opt_in" id="rn_SelectionInput_59_Incident.CustomFields.c.email_opt_in_0" value="0"/> + <label for="rn_SelectionInput_59_Incident.CustomFields.c.email_opt_in_0"> + No </label> + </fieldset> + </div> + <div id="rn_SelectionInput_61" class="rn_SelectionInput rn_Input rn_Radio"> + <fieldset> + <legend id="rn_SelectionInput_61_Label" class="rn_Label"> + Franchise Forward </legend> + <input type="radio" name="Incident.CustomFields.c.franchise_forward" id="rn_SelectionInput_61_Incident.CustomFields.c.franchise_forward_1" value="1"/> + <label for="rn_SelectionInput_61_Incident.CustomFields.c.franchise_forward_1"> + Yes </label> + <input type="radio" name="Incident.CustomFields.c.franchise_forward" id="rn_SelectionInput_61_Incident.CustomFields.c.franchise_forward_0" value="0"/> + <label for="rn_SelectionInput_61_Incident.CustomFields.c.franchise_forward_0"> + No </label> + </fieldset> + </div> + <div id="rn_TextInput_63" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_63_LabelContainer"> + <label for="rn_TextInput_63_Incident.CustomFields.c.passthrough_textarea" id="rn_TextInput_63_Label" class="rn_Label"> + Pass Through Text Area <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <textarea id="rn_TextInput_63_Incident.CustomFields.c.passthrough_textarea" class="rn_TextArea" rows="7" cols="60" name="Incident.CustomFields.c.passthrough_textarea" maxlength='4000' placeholder=" "></textarea> +</div> + <div id="rn_TextInput_65" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_65_LabelContainer"> + <label for="rn_TextInput_65_Incident.Subject" id="rn_TextInput_65_Label" class="rn_Label"> + Subject <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_65_Incident.Subject" name="Incident.Subject" class="rn_Text" maxlength='240' placeholder=" "/> + </div> + </div> + <div id="rn_TextInput_66" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_66_LabelContainer"> + <label for="rn_TextInput_66_Contact.Name.First" id="rn_TextInput_66_Label" class="rn_Label"> + First Name <span class="rn_Required"> *</span><span class="rn_ScreenReaderOnly"> Required</span> + </label> + </div> + <input type="text" id="rn_TextInput_66_Contact.Name.First" name="Contact.Name.First" class="rn_Text" maxlength='80' required placeholder=" "/> + </div> + <div id="rn_TextInput_68" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_68_LabelContainer"> + <label for="rn_TextInput_68_Contact.Name.Last" id="rn_TextInput_68_Label" class="rn_Label"> + Last Name <span class="rn_Required"> *</span><span class="rn_ScreenReaderOnly"> Required</span> + </label> + </div> + <input type="text" id="rn_TextInput_68_Contact.Name.Last" name="Contact.Name.Last" class="rn_Text" maxlength='80' required placeholder=" "/> + </div> + <div id="rn_TextInput_70" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_70_LabelContainer"> + <label for="rn_TextInput_70_Contact.Emails.PRIMARY.Address" id="rn_TextInput_70_Label" class="rn_Label"> + Email Address <span class="rn_Required"> *</span><span class="rn_ScreenReaderOnly"> Required</span> + </label> + </div> + <input type="email" id="rn_TextInput_70_Contact.Emails.PRIMARY.Address" name="Contact.Emails.PRIMARY.Address" class="rn_Email" maxlength='80' required value='' placeholder=" "/> + </div> + <div class='pn_AskFormCategoryContainer'> + <div id="rn_TextInput_72" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_72_LabelContainer"> + <label for="rn_TextInput_72_Contact.Phones.HOME.Number" id="rn_TextInput_72_Label" class="rn_Label"> + Phone Number <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_72_Contact.Phones.HOME.Number" name="Contact.Phones.HOME.Number" class="rn_Text" maxlength='40' placeholder=" "/> + </div> + <div id="rn_TextInput_74" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_74_LabelContainer"> + <label for="rn_TextInput_74_Contact.CustomFields.c.panera_my_panera_number" id="rn_TextInput_74_Label" class="rn_Label"> + MyPanera Card Number <span class="rn_Optional">Optional</span><span class="rn_ScreenReaderOnly"> Optional</span> + </label> + </div> + <input type="text" id="rn_TextInput_74_Contact.CustomFields.c.panera_my_panera_number" name="Contact.CustomFields.c.panera_my_panera_number" class="rn_Text" maxlength='13' placeholder=" "/> + </div> + <div class='pn_Divider'></div> + <div id="rn_ProductCategoryInput_75" class="rn_ProductCategoryInput rn_Input"> + <a href="javascript:void(0);" class="rn_ScreenReaderOnly" id="rn_ProductCategoryInput_75_LinksTrigger">Screen Reader users press enter to select a Select the option that best describes why you're contacting us.. <span id="rn_ProductCategoryInput_75_TreeDescription"></span></a> + <span class="rn_Label" id="rn_ProductCategoryInput_75_Label"> + Select the option that best describes why you're contacting us. <span id="rn_ProductCategoryInput_75_RequiredLabel" class="rn_Required rn_Hidden"> *</span><span id="rn_ProductCategoryInput_75_ErrorLabel" class="rn_ErrorLabel"> + <span class="rn_ScreenReaderOnly"> + Required </span> + </span> + </span> + <button type="button" id="rn_ProductCategoryInput_75_Product_Button" class="rn_DisplayButton"><span class="rn_ScreenReaderOnly">This button does not work with screen readers. Please use the previous link instead.</span> <span id="rn_ProductCategoryInput_75_Button_Visible_Text">Options</span></button> + <div class="rn_ProductCategoryLinks rn_Hidden" id="rn_ProductCategoryInput_75_Links"></div> + <div id="rn_ProductCategoryInput_75_TreeContainer" class="rn_PanelContainer rn_Hidden"> + <div id="rn_ProductCategoryInput_75_Tree" class="rn_Panel"> + </div> + </div> + </div> + <div id="rn_ProductCategoryInput_76" class="rn_ProductCategoryInput rn_Input"> + <a href="javascript:void(0);" class="rn_ScreenReaderOnly" id="rn_ProductCategoryInput_76_LinksTrigger">Screen Reader users press enter to select a Please share a bit more detail. This will help us assist you more quickly.. <span id="rn_ProductCategoryInput_76_TreeDescription"></span></a> + <span class="rn_Label" id="rn_ProductCategoryInput_76_Label"> + Please share a bit more detail. This will help us assist you more quickly. <span id="rn_ProductCategoryInput_76_RequiredLabel" class="rn_Required rn_Hidden"> *</span><span id="rn_ProductCategoryInput_76_ErrorLabel" class="rn_ErrorLabel"> + <span class="rn_ScreenReaderOnly"> + Required </span> + </span> + </span> + <button type="button" id="rn_ProductCategoryInput_76_Category_Button" class="rn_DisplayButton"><span class="rn_ScreenReaderOnly">This button does not work with screen readers. Please use the previous link instead.</span> <span id="rn_ProductCategoryInput_76_Button_Visible_Text">Details</span></button> + <div class="rn_ProductCategoryLinks rn_Hidden" id="rn_ProductCategoryInput_76_Links"></div> + <div id="rn_ProductCategoryInput_76_TreeContainer" class="rn_PanelContainer rn_Hidden"> + <div id="rn_ProductCategoryInput_76_Tree" class="rn_Panel"> + </div> + </div> + </div> + <div class='pn_Divider'></div> + <div id="rn_AskAQuestion_77" class="rn_AskAQuestion"> + <!-- PERTAINS TO CAFE ============================================= --> + <div class='pn_CheckboxInput'> + <div id="rn_SelectionInput_79" class="rn_SelectionInput rn_Input"> + <div id="rn_SelectionInput_79_LabelContainer"> + <label for="rn_SelectionInput_79_Incident.CustomFields.c.pertains_to_cafe" id="rn_SelectionInput_79_Label" class="rn_Label">Does your question pertain to a specific bakery-cafe? </label> + </div> + <input type="checkbox" id="rn_SelectionInput_79_Incident.CustomFields.c.pertains_to_cafe" name="Incident.CustomFields.c.pertains_to_cafe" value="1"/> + </div> + </div> + <!-- State Field =================================================== --> + <div id="rn_HierarchyInput_80" class="rn_HierarchyInput rn_SelectionInput rn_Input rn_Hidden"> + <div id="rn_HierarchyInput_80_LabelContainer" class=""> + <label for="rn_HierarchyInput_80_Z.CafeInfo.CafeState.ID" id="rn_HierarchyInput_80_Label" class="rn_Label"> </label> + </div> + <select id="rn_HierarchyInput_80_Z.CafeInfo.CafeState.ID" name="Z.CafeInfo.CafeState.ID"> + <option value="">State</option> + <option value="2" >AL</option> + <option value="3" >AR</option> + <option value="4" >AZ</option> + <option value="5" >CA</option> + <option value="6" >CO</option> + <option value="7" >CT</option> + <option value="8" >DC</option> + <option value="9" >DE</option> + <option value="10" >FL</option> + <option value="11" >GA</option> + <option value="12" >IA</option> + <option value="13" >ID</option> + <option value="14" >IL</option> + <option value="15" >IN</option> + <option value="16" >KS</option> + <option value="17" >KY</option> + <option value="18" >LA</option> + <option value="19" >MA</option> + <option value="20" >MD</option> + <option value="21" >ME</option> + <option value="22" >MI</option> + <option value="23" >MN</option> + <option value="24" >MO</option> + <option value="25" >MS</option> + <option value="26" >NC</option> + <option value="27" >ND</option> + <option value="28" >NE</option> + <option value="29" >NH</option> + <option value="30" >NJ</option> + <option value="31" >NM</option> + <option value="33" >NV</option> + <option value="34" >NY</option> + <option value="35" >OH</option> + <option value="36" >OK</option> + <option value="37" >ON</option> + <option value="38" >OR</option> + <option value="39" >PA</option> + <option value="40" >RI</option> + <option value="41" >SC</option> + <option value="42" >SD</option> + <option value="43" >TN</option> + <option value="44" >TX</option> + <option value="45" >UT</option> + <option value="46" >VA</option> + <option value="47" >VT</option> + <option value="48" >WA</option> + <option value="49" >WI</option> + <option value="50" >WV</option> + </select> + </div> + <!-- City Field =================================================== --> + <div id="rn_HierarchyInput_81" class="rn_HierarchyInput rn_SelectionInput rn_Input rn_Hidden"> + <div id="rn_HierarchyInput_81_LabelContainer" class=""> + <label for="rn_HierarchyInput_81_Z.CafeInfo.CafeCity.ID" id="rn_HierarchyInput_81_Label" class="rn_Label"> </label> + </div> + <select id="rn_HierarchyInput_81_Z.CafeInfo.CafeCity.ID" name="Z.CafeInfo.CafeCity.ID"> + <option value="">City</option> + </select> + </div> + <!-- Location Field =================================================== --> + <div id="rn_HierarchyInput_82" class="rn_HierarchyInput rn_SelectionInput rn_Input rn_Hidden"> + <div id="rn_HierarchyInput_82_LabelContainer" class="rn_Hidden"> + <label for="rn_HierarchyInput_82_X.Incident.CustomFields.CafeInfo.AssociatedCafe.ID" id="rn_HierarchyInput_82_Label" class="rn_Label">Bakery-Cafe </label> + </div> + <select id="rn_HierarchyInput_82_X.Incident.CustomFields.CafeInfo.AssociatedCafe.ID" name="X.Incident.CustomFields.CafeInfo.AssociatedCafe.ID"> + <option value="">Bakery-Cafe</option> + </select> + </div> +</di> + <div class='pn_Divider'></div> + </div> + <div class='pn_Textarea'> + <div id="rn_TextInput_83" class="rn_TextInput rn_TextInput rn_Input"> + <div id="rn_TextInput_83_LabelContainer"> + <label for="rn_TextInput_83_Incident.Threads" id="rn_TextInput_83_Label" class="rn_Label"> + We’d love to hear your feedback. Please share your comments, questions or suggestions here. <span class="rn_Required"> *</span><span class="rn_ScreenReaderOnly"> Required</span> + </label> + </div> + <textarea id="rn_TextInput_83_Incident.Threads" class="rn_TextArea" rows="7" cols="60" name="Incident.Threads" maxlength='500' required placeholder="Your Feedback"></textarea> +<div class='rn_CharacterCount'>( <span id='rn_TextInput_83_CharacterCount'>500</span> )</div> +</div> + </div> + <div class='pn_CheckboxInput'> + <div id="rn_SelectionInput_85" class="rn_SelectionInput rn_Input"> + <div id="rn_SelectionInput_85_LabelContainer"> + <label for="rn_SelectionInput_85_Incident.CustomFields.c.email_opt_in" id="rn_SelectionInput_85_Label" class="rn_Label">If you would like a response from our Customer Care Team, please make sure this box is checked. </label> + </div> + <input type="checkbox" id="rn_SelectionInput_85_Incident.CustomFields.c.email_opt_in" name="Incident.CustomFields.c.email_opt_in" checked="checked" value="1"/> + </div> + </div> + <div id="rn_FormSubmit_86" class="rn_FormSubmit"> + <button type="submit" id="rn_FormSubmit_86_Button" disabled> + Send </button> + <span class="rn_Hidden"> + <input id="rn_FormSubmit_86_Submission" type="checkbox" class="rn_Hidden"/> + <label for="rn_FormSubmit_86_Submission" class="rn_Hidden"> </label> + </span> +</div> + <div id="rn_SmartAssistantDialog_87" class="rn_SmartAssistantDialog rn_Hidden"> + <div class="rn_MessageBox rn_InfoMessage"> + <span id="rn_SmartAssistantDialog_87_DialogHeading" class="rn_Heading"></span> + </div> + <div id="rn_SmartAssistantDialog_87_DialogContent"></div> +</div> + </form> +</div> + </div> + <div class='pn_Divider'></div> + <div class="pn_Shortcuts"> + <div> + <h1> + Quick Links + </h1> + <div> + <ul> + <li><a href='//www.panerabread.com'>Panera Bread</a></li> + <li><a href='//delivery.panerabread.com/#!/'>Order Online</a></li> + <li><a href='//cater.panerabread.com/'>Panera Catering</a></li> + </ul> + </div> + </div> + </div> + <div class='pn_Divider'></div> + <div class='pn_AppStoresContainer'> + <div> + <h1> + It's Easier Than Ever + </h1> + <p> + Use your smartphone to order from your favorites, save customized items, schedule pick-up times, and pay quickly and easily. + </p> + <div class='pn_AppStoresIconsContainer'> + <a href='//itunes.apple.com/us/app/panera-bread/id692365393?mt=8'> + <img src='images/panera/download-on-the-app-store-badge.png'/> + </a> + <a href='//play.google.com/store/apps/details?id=com.panera.bread&hl=en'> + <img src='images/panera/google-play-badge.png'/> + </a> + </div> + </div> + </div> + <div class='pn_Divider'></div> + <div class='rn_PaneraHelp rn_Hidden' id='ContactChannels'> + <h1> + How Can We Help? + </h1> + <p> + Connect with a member of our Customer Care Team + </p> + <ul> + <li class='rn_Hidden' data-channel='chat'> + <a href='/app/chat/chat_launch'> + <img src='images/panera/chat.png'/> + <h5> + Live Chat + </h5> + <p> + Chat support is available Monday - Friday 7 AM - 6PM CDT. </p> + </a> + </li> + <li class='rn_Hidden' data-channel='email'> + <a href='/app/ask'> + <img src='images/panera/email.png'/> + <h5> + Email Us + </h5> + <p> + Our Customer Care Team will reply as soon as possible. + </p> + </a> + </li> + <li class='rn_Hidden' data-channel='call'> + <a href='/app/call'> + <img src='images/panera/phone.png'/> + <h5>Call Us</h5> + <p> + Phone support is available every day from 5 AM - 10 PM CDT </p> + </a> + </li> + </ul> + </div> + <div class='pn_SupportHours'> + <div id="rn_ChatHours_88" class="rn_ChatHours"> + <div id="rn_ChatHours_88_HoursLabel" class="rn_HoursLabel"> + Customer Care Support Hours </div> + <div id="rn_ChatHours_88_HoursBlock" class="rn_HoursBlock"> + <div> + <span id="rn_ChatHours_88_HoursPrefix_0" class="rn_HoursPrefix"> + Monday - Friday: + </span> + <span id="rn_ChatHours_88_Hours_0" class="rn_Hours"> + 07:00 AM - 06:00 PM CDT </span> + </div> + <div> + <span id="rn_ChatHours_88_HoursPrefix_1" class="rn_HoursPrefix"> + Saturday - Sunday: + </span> + <span id="rn_ChatHours_88_Hours_1" class="rn_Hours"> + Closed </span> + </div> + </div> + <div id="rn_ChatHours_88_CurrentTime" class="rn_CurrentTime"> + It is currently Thursday, Aug. 10, 2017 11:24 AM CDT </div> +</div> + </div> + <div class='pn_Footer'> + <div class='pn_TermsAndPrivacy'> + <a href='https://www.panerabread.com/en-us/company-information/terms-of-use.html'>Terms of Use</a> + <a href='https://www.panerabread.com/en-us/company-information/privacy-policy.html'>Privacy Policy</a> + </div> + <div class='pn_Copyright'> + Copyright ©2017 Panera Bread. All rights reserved. + </div> + </div> +</div> +</div> +<script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + ga('create', 'UA-92065830-1', 'auto'); + ga('send', 'pageview'); +</script> +<script>var YUI_config={"fetchCSS":false,"modules":{"RightNowTreeView":"/euf/core/3.3/js/7.243/min/modules/ui/treeview.js","RightNowTreeViewDialog":"/euf/core/3.3/js/7.243/min/modules/ui/treeviewdialog.js","RightNowTreeViewDropdown":"/euf/core/3.3/js/7.243/min/modules/ui/treeviewdropdown.js"},"lang":["en-US","en-US"],"injected":true,"comboBase":"//panera.widget.custhelp.com/ci/cache/yuiCombo/","groups":{"gallery-treeview":{"base":"/rnt/rnw/yui_3.17/gallery-treeview/","modules":{"gallery-treeview":{"path":"gallery-treeview-min.js"}}}}};</script> +<script type="text/javascript" src="/euf/core/3.3/js/7.243/min/RightNow.js"></script> +<script type="text/javascript" src="/euf/generated/optimized/1500491352/templates/standard.cb83c9cb83daf85fcdbe1a3be8a0d965.js"></script> +<script type="text/javascript" src="/euf/generated/optimized/1500491352/pages/ask.f181002c61ca1d6b69466c6b9f90674e.js"></script> +<script type="text/javascript" src="/euf/generated/optimized/1500491352/custom/autoload.js"></script> +<script> +/* <![CDATA[ */ +RightNow.Env=(function(){var _props={module:'standard',coreAssets:'/euf/core/3.3/',yuiCore:'/rnt/rnw/yui_3.17/',profileData:{"isLoggedIn":false,"previouslySeenEmail":null}};return function(prop){return _props[prop];};})();RightNow.Interface.setMessagebase(function(){return {"WARNING_LBL":"Warning","INFORMATION_LBL":"Information","HELP_LBL":"Help","ERROR_REQUEST_ACTION_COMPLETED_MSG":"There was an error with the request and the action could not be completed.","OK_LBL":"OK","DIALOG_LBL":"dialog","DIALOG_PLEASE_READ_TEXT_DIALOG_MSG_MSG":"dialog, please read above text for dialog message","BEG_DIALOG_PLS_DISMISS_DIALOG_BEF_MSG":"Beginning of dialog, please dismiss dialog before continuing","END_DIALOG_PLS_DISMISS_DIALOG_BEF_MSG":"End of dialog, please dismiss dialog before continuing","ERR_SUBMITTING_FORM_DUE_INV_INPUT_LBL":"There was an error submitting the form due to invalid input","ERR_SUBMITTING_SEARCH_MSG":"There was a problem with your request. Please change your search terms and try again.","CLOSE_CMD":"Close","BACK_LBL":"Back","VALUE_MUST_BE_AN_INTEGER_MSG":"value must be an integer","VALUE_IS_TOO_LARGE_MAX_VALUE_MSG":"value is too large (max value: ","VALUE_IS_TOO_SMALL_MIN_VALUE_MSG":"value is too small (min value: ","CONTAIN_1_CHARACTER_MSG":"must contain at least 1 more character","PCT_D_CHARACTERS_MSG":"must be at least %d characters long.","EXCEEDS_SZ_LIMIT_PCT_D_CHARS_1_LBL":"exceeds its size limit of %d characters by 1 character","EXCEEDS_SZ_LIMIT_PCT_D_CHARS_PCT_D_LBL":"exceeds its size limit of %d characters by %d characters","PCT_S_IS_AN_INVALID_POSTAL_CODE_MSG":"%s is an invalid postal code","PCT_S_IS_AN_INVALID_PHONE_NUMBER_MSG":"%s is an invalid phone number","PCT_S_CONT_SPACES_DOUBLE_QUOTES_LBL":"%s cannot contain spaces, double quotes or <>","PCT_S_DIDNT_MATCH_EXPECTED_INPUT_LBL":"%s didn't match expected input","CONTAIN_SPACES_PLEASE_TRY_MSG":"must not contain spaces. Please try again.","PCT_S_IS_INVALID_MSG":"%s is invalid","IS_NOT_A_VALID_URL_MSG":"is not a valid URL","FORMSUBMIT_PLACED_FORM_UNIQUE_ID_MSG":"FormSubmit must be placed within a form with a unique ID.","PLS_VERIFY_REQ_ENTERING_TEXT_IMG_MSG":"Please verify your request by entering the text in the image.","CANCEL_CMD":"Cancel","PCT_S_LNKS_DEPTH_ANNOUNCED_MSG":"%s below using the links provided. Depth is announced as you navigate through the list.","SELECTION_PCT_S_ACTIVATE_LINK_JUMP_MSG":"The current selection is: '%s'. Activate this link to jump to the current selection.","FIELD_REQUIRED_MARK_LBL":"*","REQUIRED_LBL":"Required","EXPECTED_INPUT_LBL":"Expected Input","WAITING_FOR_CHARACTER_LBL":"Waiting for character: ' ","PLEASE_TYPE_A_NUMBER_MSG":"Please type a number","PLEASE_ENTER_UPPERCASE_LETTER_MSG":"Please enter an uppercase letter or a number","PLEASE_ENTER_AN_UPPERCASE_LETTER_MSG":"Please enter an uppercase letter","PLS_ENTER_UPPERCASE_LETTER_SPECIAL_MSG":"Please enter an uppercase letter, a number or a special character","PLEASE_ENTER_LOWERCASE_LETTER_MSG":"Please enter a lowercase letter or a number","PLEASE_ENTER_A_LOWERCASE_LETTER_MSG":"Please enter a lowercase letter","PLS_ENTER_LOWERCASE_LETTER_SPECIAL_MSG":"Please enter a lowercase letter, a number or a special character","PLEASE_ENTER_A_LETTER_OR_A_NUMBER_MSG":"Please enter a letter or a number","PLEASE_ENTER_A_LETTER_MSG":"Please enter a letter","PLEASE_ENTER_LETTER_SPECIAL_CHAR_MSG":"Please enter a letter, a number or a special character","THE_INPUT_IS_TOO_LONG_MSG":"The input is too long","THE_INPUT_IS_TOO_SHORT_MSG":"The input is too short","CHARACTER_LBL":"Character","ERROR_PAGE_PLEASE_S_TRY_MSG":"There is an error on the page. Please correct the problem(s) and try again.","ACCESSKEY_LBL":"Accesskey","ALT_LBL":"Alt","ALT_PLUS_SHIFT_LBL":"Alt + Shift","CTRL_LBL":"Ctrl","CTRL_PLUS_OPT_LBL":"Ctrl + Opt","LOADING_ELLIPSES_LBL":"Loading...","OPEN_THIS_ENTIRE_DISCUSSION_NEW_WINDOW_MSG":"Open this entire discussion in a new window.","PCT_S_IS_NOT_COMPLETELY_FILLED_IN_MSG":"%s is not completely filled in","PCT_S_IS_NOT_A_VALID_DATE_MSG":"%s is not a valid date","VALUE_MIN_VALUE_PCT_S_MSG":"value is too small (min value: %s)","PCT_S_REQUIREMENTS_MET_LBL":"%s requirements have not been met","PASSWD_VALIDATION_REQS_READ_L_MSG":"For password validation requirements, read the list below.","PASSWORD_IS_TOO_SHORT_MSG":"Password is too short","PERFECT_LBL":"Perfect","PASSWORD_IS_TOO_INSECURE_MSG":"Password is too insecure","COMPLETE_LBL":"Complete","INCOMPLETE_LBL":"Incomplete"};}); +RightNow.Interface.setConfigbase(function(){return {"DE_VALID_EMAIL_PATTERN":"^(([-!#$%&'*+\/=?^~`{|}\\w\\x80-\\xFF]+(\\.[-!#$%&'*+\/=?^~`{|}\\w\\x80-\\xFF]+)*)|(\"[^\"]+\"))@[0-9A-Za-z]+(-[0-9A-Za-z]+)*(\\.[0-9A-Za-z]+(-[0-9A-Za-z]+)*)+$","CP_HOME_URL":"home","CP_FILE_UPLOAD_MAX_TIME":300,"OE_WEB_SERVER":"panera.custhelp.com","SUBMIT_TOKEN_EXP":30,"CP_ANSWERS_DETAIL_URL":"answers\/detail","CP_SOCIAL_QUESTIONS_DETAIL_URL":"social\/questions\/detail"};}); +RightNow.Url.setParameterSegment(4); +RightNow.Interface.Constants = +{"API_VALIDATION_REGEX_EMAIL":"((([-_!#$%&'*+\/=?^~`{|}\\w]+([.][-_!#$%&'*+\/=?^~`{|}\\w]*)*)|(\"[^\"]+\"))@[0-9A-Za-z]+([\\-]+[0-9A-Za-z]+)*(\\.[0-9A-Za-z]+([\\-]+[0-9A-Za-z]+)*)+[;, ]*)+"}; +YUI().use('event-base',function(Y){Y.on('domready',function(){var n=RightNow.namespace,W=RightNow.Widgets,c='createWidgetInstance'; +n('RightNow.Widgets.SelectionInput').templates={"label":"<% if (label) { %> <label for=\"rn_<%= instanceID %>_<%= fieldName %>\" id=\"rn_<%= instanceID %>_Label\" class=\"rn_Label\"> <%= label %> <% if (required) { %> <span class=\"rn_Required\"> <%= requiredMarkLabel %><\/span><span class=\"rn_ScreenReaderOnly\"><%= requiredLabel %><\/span> <% } %> <% if (hint) { %> <span class=\"rn_ScreenReaderOnly\"><%= hint %><\/span> <% } %> <\/label> <% } %>","legend":"<% if (label) { %> <%= label %> <% if (required) { %> <span class=\"rn_Required\"><%= requiredMarkLabel %><\/span><span class=\"rn_ScreenReaderOnly\"><%= requiredLabel %><\/span> <% } %> <% } %>"}; +n('RightNow.Widgets.DateInput').templates={"legend":"<% if (label) { %> <%= label %> <% if (required) { %> <span class=\"rn_Required\"><%= requiredMarkLabel %><\/span><span class=\"rn_ScreenReaderOnly\"><%= requiredLabel %><\/span> <% } %> <% } %>"}; +n('Custom.Widgets.input.TextInput').requires=["anim"]; +n('RightNow.Widgets.ProductCategoryInput').templates={"label":"<%= label %><% if(requiredLevel) { %><span class=\"rn_Required\"> <%= requiredMarkLabel %><\/span><span id=\"rn_<%= instanceID %>_ErrorLabel\" class=\"rn_ErrorLabel\"> <span class=\"rn_ScreenReaderOnly\"> <%= requiredLabel %> <\/span><\/span><% } %>"}; +n('RightNow.Widgets.ProductCategoryInput').requires=["panel","overlay","gallery-treeview","RightNowTreeView","RightNowTreeViewDialog","RightNowTreeViewDropdown"]; +n('Custom.Widgets.input.HierarchyInput').templates={"label":"<% if (label) { %> <label for=\"rn_<%= instanceID %>_<%= fieldName %>\" id=\"rn_<%= instanceID %>_Label\" class=\"rn_Label\"> <%= label %> <% if (required) { %> <span class=\"rn_Required\"> <%= requiredMarkLabel %><\/span><span class=\"rn_ScreenReaderOnly\"><%= requiredLabel %><\/span> <% } %> <% if (hint) { %> <span class=\"rn_ScreenReaderOnly\"><%= hint %><\/span> <% } %> <\/label> <% } %>","legend":"<% if (label) { %> <%= label %> <% if (required) { %> <span class=\"rn_Required\"><%= requiredMarkLabel %><\/span><span class=\"rn_ScreenReaderOnly\"><%= requiredLabel %><\/span> <% } %> <% } %>"}; +n('RightNow.Widgets.FormSubmit').requires=["anim-scroll"]; +n('RightNow.Widgets.SmartAssistantDialog').templates={"answerContent":"<span id=\"<%= spanID %>\" class=\"rn_Answer rn_AnswerDetail rn_Hidden\"> <% if(question) { %> <span class=\"rn_AnswerSummary\"><%= question %><\/span> <% } %> <span class=\"rn_AnswerSolution\"><%= contents %><\/span><\/span>","answerLink":"<a target=\"_blank\" href=\"<%= href %>\" onclick='RightNow.ActionCapture.record(\"smartAssistantResult\", \"view\", <%= answerID %>);'> <%= text %><\/a>","discussionContent":"<div id=\"<%= spanID %>\" class=\"rn_Answer rn_AnswerDetail rn_Hidden\"> <% if(discussion) { %> <span class=\"rn_UserAvatar rn_UserAvatarLeft rn_SocialQuestionAuthor\"> <%= getDefaultAvatar({'avatarUrl': avatarURL, 'size': 48, 'displayName': displayName, 'isActive': !(userStatus in js.statuses.suspended), 'className': 'rn_Medium'})%> <span class=\"rn_DisplayName\" itemprop=\"name\"><%= displayName %><\/span> <\/span> <span class=\"rn_OpenDiscussionLinkText\"> <a href=\"<%= '\/app\/' + RightNow.Interface.getConfig('CP_SOCIAL_QUESTIONS_DETAIL_URL') + '\/qid\/' + objectID + sessionParam %>\"> <%= RightNow.Interface.getMessage('OPEN_THIS_ENTIRE_DISCUSSION_NEW_WINDOW_MSG') %> <\/a> <\/span> <span class=\"rn_AnswerDiscussionSummary\"><%= discussion %><\/span> <% } %> <% if(bestAnswerExists) { %> <ul class=\"rn_Solution_List\"> <% for(var objKey in solution) { %> <% if(solution[objKey].SocialQuestionComment.Body) { %> <li class=\"rn_BestAnswerImage\"> <span class=\"rn_UserAvatar rn_UserAvatarLeft rn_SocialQuestionCommentAuthor\"> <%= getDefaultAvatar({'avatarUrl': solution[objKey].SocialQuestionComment.CreatedBySocialUser.AvatarURL, 'size': 48, 'displayName': solution[objKey].SocialQuestionComment.CreatedBySocialUser.DisplayName, 'isActive': !(solution[objKey].SocialQuestionComment.CreatedBySocialUser.StatusWithType.Status.ID in js.statuses.suspended), 'className': 'rn_Medium'})%> <span class=\"rn_DisplayName\" itemprop=\"name\"><%= solution[objKey].SocialQuestionComment.CreatedBySocialUser.DisplayName %><\/span> <\/span> <span class=\"rn_DiscussionSolution\"><%= solution[objKey].SocialQuestionComment.Body %><\/span> <\/li> <% } } %> <\/ul> <% } %> <span class=\"rn_OpenDiscussionLinkText\"> <a href=\"<%= '\/app\/' + RightNow.Interface.getConfig('CP_SOCIAL_QUESTIONS_DETAIL_URL') + '\/qid\/' + objectID + sessionParam %>\"> <%= RightNow.Interface.getMessage('OPEN_THIS_ENTIRE_DISCUSSION_NEW_WINDOW_MSG') %> <\/a> <\/span><\/div>","displayResults":"<% var promptDisplayed = false, accessKeyNumber = 0; %><% for(var i = 0, suggestion; i < suggestions.length; i++) { suggestion = suggestions[i]; if(!promptDisplayed && (suggestion.type === 'AnswerSummary' || suggestion.type === 'QuestionSummary')) { promptDisplayed = true; %> <div class=\"rn_Prompt\"><%= attrs.label_prompt %> <% if(attrs.accesskeys_enabled && attrs.label_accesskey && attrs.display_inline) { %> <div class=\"rn_AccesskeyPrompt\"><%= accessKeyPrompt %><\/div> <% } %> <\/div> <% } if(suggestion.type === 'AnswerSummary') { %> <ul class=\"rn_List <%= (attrs.display_inline) ? 'rn_InlineAnswers' : '' %>\"> <% for(var j = 0; j < suggestion.list.length; j++) { var answerID = suggestion.list[j].ID ? suggestion.list[j].ID : j; if(attrs.display_inline) { %> <li> <% if(attrs.accesskeys_enabled) { %> <a href=\"javascript:void(0)\" accesskey=\"<%=++accessKeyNumber%>\" data-id=\"<%=answerID%>\" data-url=\"<%=suggestion.list[j].url%>\" class=\"rn_InlineAnswerLink rn_ExpandAnswer\" id=\"<%=baseDomID + '_Answer' + answerID %>\" data-object-type=\"answer\"> <% } else { %> <a href=\"javascript:void(0)\" data-id=\"<%=answerID%>\" data-url=\"<%=suggestion.list[j].url%>\" class=\"rn_InlineAnswerLink rn_ExpandAnswer\" id=\"<%=baseDomID + '_Answer' + answerID %>\" data-object-type=\"answer\"> <% } %> <span class=\"rn_KBAnswerImage\"><\/span> <%= suggestion.list[j].title %> <span class=\"rn_ScreenReaderOnly\" role=\"alert\" id=\"<%=baseDomID + '_Answer' + answerID + '_Alternative'%>\"> <%= attrs.label_collapsed %> <\/span> <\/a> <\/li> <% } else { %> <li> <a target=\"_blank\" href=\"<%= '\/app\/' + answerUrl + '\/a_id\/' + answerID + sessionParam %>\" onclick='RightNow.ActionCapture.record(\"smartAssistantResult\", \"view\", <%=answerID%>);'><%=suggestion.list[j].title%><\/a> <\/li> <% } %> <% } %> <\/ul> <% } else if(suggestion.type === 'Answer') { %> <div class=\"rn_Answer\"> <% if(suggestion.FileAttachments === null || suggestion.FileAttachments === undefined) { %> <div class=\"rn_Summary\"><%=suggestion.title%><\/div> <div class=\"rn_Solution\"><%=suggestion.content%><\/div> <% } else { %> <a target=\"_blank\" href=\"<%= '\/app\/' + answerUrl + '\/a_id\/' + suggestion.ID + sessionParam %>\" onclick='RightNow.ActionCapture.record(\"smartAssistantResult\", \"view\", <%=suggestion.ID%>);'><%=suggestion.title%><\/a> <% } %> <\/div> <% } else if(suggestion.type === 'QuestionSummary') { %> <ul class=\"rn_List <%= (attrs.display_inline) ? 'rn_InlineAnswers' : '' %>\"> <% for(var j = 0; j < suggestion.list.length; j++) { %> <% if(attrs.display_inline) { %> <li> <% if(attrs.accesskeys_enabled) { %> <a href=\"javascript:void(0)\" accesskey=\"<%=++accessKeyNumber%>\" data-id=\"<%=suggestion.list[j].ID%>\" data-object-type=\"discussion\" class=\"rn_InlineAnswerLink rn_ExpandAnswer\" id=\"<%=baseDomID + '_Answer' + suggestion.list[j].ID %>\"> <% } else { %> <a href=\"javascript:void(0)\" data-id=\"<%=suggestion.list[j].ID%>\" data-object-type=\"discussion\" class=\"rn_InlineAnswerLink rn_ExpandAnswer\" id=\"<%=baseDomID + '_Answer' + suggestion.list[j].ID %>\"> <% } %> <span class=\"rn_SocialDiscussionImage\"><\/span> <%= suggestion.list[j].title %> <span class=\"rn_ScreenReaderOnly\" role=\"alert\" id=\"<%=baseDomID + '_Answer' + suggestion.list[j].ID + '_Alternative'%>\"> <%= attrs.label_collapsed %> <\/span> <\/a> <\/li> <% } else { %> <li> <a target=\"_blank\" href=\"<%= '\/app\/' + RightNow.Interface.getConfig('CP_SOCIAL_QUESTIONS_DETAIL_URL') + '\/qid\/' + suggestion.list[j].ID + sessionParam %>\" onclick='RightNow.ActionCapture.record(\"smartAssistantResult\", \"view\", <%=suggestion.list[j].ID%>);'> <%=suggestion.list[j].title%> <\/a> <\/li> <% } %> <% } %> <\/ul> <% } else { %> <div class=\"rn_Response\"><%=suggestion.content%><\/div> <% } %><% } %>"}; +W.setInitialWidgetCount(48); +W[c]({"i":{"c":"KeywordText","n":"KeywordText","w":3},"a":{"report_id":"176","source_id":"","label_text":"Search by Keyword","initial_focus":true,"label_placeholder":"Search for answers","rn_container_id":"rnc_1","rn_container":"true"},"j":{"initialValue":"","rnSearchType":"keyword","searchName":"keyword"}},'W10=','fU1j3Zgp9a1p86EuBbz_AaeqZGnqQ7RxMJ~Xer4~h4W65pSv06cmWvo2_kjX5p47pRXx6Qdv477FY5GhLP_Gek62XYsI4E9RwO9JVQEI4~pTqclvdGtEhHySf01m3Fw4k~j95v2yBfujY!',1502382271,'KeywordText_3','standard/search/KeywordText','RightNow.Widgets.KeywordText','3'); +W[c]({"i":{"c":"SearchButton","n":"SearchButton","w":4},"a":{"report_id":"176","source_id":"","label_button":"Search","report_page_url":"\/app\/answers\/list","icon_path":"","icon_alt_text":"Search","target":"_self","popup_window":false,"popup_window_width_percent":30,"popup_window_height_percent":42,"force_page_flip":true,"rn_container_id":"rnc_1","rn_container":"true"},"j":[]},'W10=','fUgt~d_2WUwDP8aSPH0P4nA52ENncmbkrywv3oV1uuujCl5f0iuSQefn8Orvee7GksSj6wZibT3oQOK05oP~Lq2lLZkhLFiYUXZyhLmzsLkbEM_CQBm6uHLZ6Z_M54CS769kyt8kpeZyE!',1502382271,'SearchButton_4','standard/search/SearchButton','RightNow.Widgets.SearchButton','4'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":7},"a":{"label_input":"Escalated Gift Card - Devalue","label_required":"%s is required","name":"Incident.CustomFields.c.escalated_gift_card_devalue","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"Boolean","name":"Incident.CustomFields.c.escalated_gift_card_devalue","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUvAcE7C7Qp~i7qFvALf9uclLhz1WmXzijgO5boCbzqMoCsxK_kJcYizt_EvFVihxjIGEkK58G_AjyGvJvbwXTK0vvPqAdLPGef38m2ogQIB~SV6bHgyO65I5PXC9WS5WkK1YOLgK00eg!',1502382271,'SelectionInput_7','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','7'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":9},"a":{"label_input":"Escalated - Catering Sales","label_required":"%s is required","name":"Incident.CustomFields.c.escalated_catering_sales","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"Boolean","name":"Incident.CustomFields.c.escalated_catering_sales","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUCx1hfqLQBkBVLsN44zjULw~KsHgvx1BlvuLfaSpJj26DJbw8hr2n1XzXapWBXSTyfqSDku16lwPpE4F1Geh6z5atQoAidTZFewgR7~WZ0rMVDGDpf8RnlmGo8Xis65KJQ0~mFAxI20Y!',1502382271,'SelectionInput_9','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','9'); +W[c]({"i":{"c":"DateInput","n":"DateInput","w":11},"a":{"label_input":"PA Team Escalated Team Assign","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.pa_team_escalated_team_assign","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"min_year":1970,"max_year":2017,"hide_on_load":false,"read_only":false,"sub_id":"date","table":"Incident","always_show_mask":"false"},"j":{"type":"DateTime","name":"Incident.CustomFields.c.pa_team_escalated_team_assign","custom":true,"constraints":{"minValue":86400,"maxValue":2147385599},"mask":null,"readOnly":false,"min":{"year":1970,"month":1,"day":3,"hour":0,"time":"00:00:00","date":"1970-1-3 00:00:00"},"min_val":"1\/3\/1970 00:00:00"}},'W10=','fUJNcxbkia3pYKeNrsZfwmrJuh_62kTQBL4hbhM2zqEW4reeHdl~fJl8UW9DEAX25eESMyOUNQTmztceHnR_katMZOOZKZrrCvKGuinPT~FJx7OiqzF22ZCY1PoX3S3IwGc_ZLzelzxpg!',1502382271,'DateInput_11','standard/input/DateInput','RightNow.Widgets.DateInput','11'); +W[c]({"i":{"c":"DateInput","n":"DateInput","w":13},"a":{"label_input":"PA Team Initial Tracking","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.pa_team_initial_tracking","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"min_year":1970,"max_year":2017,"hide_on_load":false,"read_only":false,"sub_id":"date","table":"Incident","always_show_mask":"false"},"j":{"type":"DateTime","name":"Incident.CustomFields.c.pa_team_initial_tracking","custom":true,"constraints":{"minValue":86400,"maxValue":2147385599},"mask":null,"readOnly":false,"min":{"year":1970,"month":1,"day":3,"hour":0,"time":"00:00:00","date":"1970-1-3 00:00:00"},"min_val":"1\/3\/1970 00:00:00"}},'W10=','fUazXA2Jlv5FaofCF9HiwNLZNWV_q6f7D49GqdMMdX3DT97IumJY9gFa1E4SAMFsQW3f_ar6yyPWoDXxf9TXUHpa~755HrhLjlvKKP0w_M0QMAABn24BGQeBbFx2~EgdhDLvRPaHpqYGg!',1502382271,'DateInput_13','standard/input/DateInput','RightNow.Widgets.DateInput','13'); +W[c]({"i":{"c":"DateInput","n":"DateInput","w":15},"a":{"label_input":"PA Team Analyst Assignment","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.pa_team_analyst_assignment","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"min_year":1970,"max_year":2017,"hide_on_load":false,"read_only":false,"sub_id":"date","table":"Incident","always_show_mask":"false"},"j":{"type":"DateTime","name":"Incident.CustomFields.c.pa_team_analyst_assignment","custom":true,"constraints":{"minValue":86400,"maxValue":2147385599},"mask":null,"readOnly":false,"min":{"year":1970,"month":1,"day":3,"hour":0,"time":"00:00:00","date":"1970-1-3 00:00:00"},"min_val":"1\/3\/1970 00:00:00"}},'W10=','fUQr_7tqdSuN3Yk5FmPHW4hSynnGBayqFwqmhAnCa720GZk0~QZvq5noaQ~_lr7WIGOCpWo79j2MZysr7gUiGyav2rdgHrAZ_WiEhDMNL180KE9UqHDG4~m5~tsY5az1MO0DDMIhCku~M!',1502382271,'DateInput_15','standard/input/DateInput','RightNow.Widgets.DateInput','15'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":17},"a":{"placeholder_text":" ","label_input":"PA External Reference","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.pa_external_reference_nbr","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text","table":"Incident"},"j":{"type":"String","name":"Incident.CustomFields.c.pa_external_reference_nbr","custom":true,"constraints":{"maxLength":20},"mask":null,"readOnly":false,"contactToken":"ZlVuTGl1QTFkUUJBWGlIamtRYVF5Vl9mOG5fck4zMVMyZGNuU0hVTnVyNG1qa2xOY0VxQzRtZ2YwRERHa05IWWMyTk9lQ3h2Y2RUNkw0ejFJdE9BTU54ODRhb0o1YWJjN2NvWVlyWWwwUkJZRkxzX01SRHh1WmlPOGIyamJaZTJLeVBDNzNrc0NwMzB3IQ!!"}},'W10=','fU5aQxYO3DkKCzcT9icnPP89SRNoOZ98YqPD_7uni0qSrcHyPJF~0PJAUQeaE3lP2rapnxwlBW5FiKk~mn0BorJsLtpUYWUGfv05pFOHCjRbi4Qlwv0u0KD589EAiYQiQDRMB44q8bavY!',1502382271,'TextInput_17','custom/input/TextInput','Custom.Widgets.input.TextInput','17'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":19},"a":{"label_input":"PA Tracking Monitor Control","label_required":"%s is required","name":"Incident.CustomFields.c.pa_tracking_monitor_control","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"Boolean","name":"Incident.CustomFields.c.pa_tracking_monitor_control","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUC_reMJLxwrkSn4jNVWGhOoeSgouofNOpZYoGCZZlWsjFjaz~8mX6rWmNnetsLzOpm_BCyAulm4kR~T7E9hwDG5lhdEWICERxZLWNdDEeJUfQFnX6Xk7X2~DqxyqMPqk~oipvC3vzBhI!',1502382271,'SelectionInput_19','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','19'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":21},"a":{"label_input":"Gift Card Agent","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_super_agent","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"Boolean","name":"Incident.CustomFields.c.gift_card_super_agent","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUXWMfIXtZjsJXwWSJQBm5kasd4ejEdh~dlmp4Yll2RntczJ0e_IM~XQr85eeNAajVBCr0kVgCY8bC~RIE7IMENGRti3Exdh7Rfgnn1g6IS0vWgav3WJKi~8C~ZDqjLAIyJhijmV_HEgA!',1502382271,'SelectionInput_21','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','21'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":23},"a":{"label_input":"Gift Card Request Type","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_request_type","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"NamedIDLabel","name":"Incident.CustomFields.c.gift_card_request_type","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUB95_k~58Hcy9Gd9bEMgbj0ECFxFEryx7n4bQ6pVNsu6oqonlhCMxtdCFYWSX8JHEB0pqpmm7TzUGeKq4zwRC1jFjBIggLh_DX2nIrnebsOk3kudw6kmPyMHlYPeEshxd3jjyedFEZ~s!',1502382271,'SelectionInput_23','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','23'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":25},"a":{"label_input":"Gift Card Action","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_action","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"NamedIDLabel","name":"Incident.CustomFields.c.gift_card_action","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUYFXSnrTtZOHGE244dp1NLX2xzQgGSa2QWQdplAkjvl_Wnj367uxPebxhwBEATyKG6OAkUY4IQx6gn40ZsEnbRAwZG9QKIGKhIwj~oECLqxRw3J_fZKwDSJSyJ6MoX7FmMJpzgpb2wbA!',1502382271,'SelectionInput_25','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','25'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":27},"a":{"label_input":"Gift Card Issuer (person)","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_issuer_person","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"NamedIDLabel","name":"Incident.CustomFields.c.gift_card_issuer_person","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUUtD25PVOgqmTOVLbudjOMUByzvyfRfvh4B8hFPS87v2AqTa~U1rjj975AM39qDeHGgjvmRqP3V40503_dvLytDZlLyIctz6uhJbX9iEJVO0gqm4mLlSrCcjvf1sXXS~8O0NXghANtao!',1502382271,'SelectionInput_27','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','27'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":29},"a":{"placeholder_text":" ","label_input":"Gift Card Appeasement $","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_appeasement_amt","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text","table":"Incident"},"j":{"type":"String","name":"Incident.CustomFields.c.gift_card_appeasement_amt","custom":true,"constraints":{"maxLength":10},"mask":null,"readOnly":false,"contactToken":"ZlVwOG5WSlNCM3pLWkVNMlp4NEZlTldLZHIwMGxyfn5fV3Z1ZWhYeXdSMnVjYTgxUTFITDl2a2Q2WmNZRkk3a1lreWF6WTJraXRHVnZEUlhwd2ZPNU0yUlpybE1tc3lYZUFHX354VEZRX0xOM2I5clFDVFpLcmtzSGxORjdmTjBRdG9mVmRPaXNualNnIQ!!"}},'W10=','fUFY6mu8IuTclN1lfnKDPXk3oiXvqEHJCF1vU6vPxlUiXH6pwqJrPoOkKF9sAcQ6pl2Cv0X3WT_QKAdATIDWFO2PVqeqICZiAOGTbAt5rBCvDVQH21yZVyUE2TvIZ5CMJiVevCSQ9cOFU!',1502382271,'TextInput_29','custom/input/TextInput','Custom.Widgets.input.TextInput','29'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":31},"a":{"placeholder_text":" ","label_input":"Gift Card Amount (new)","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_amount_new","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text","table":"Incident"},"j":{"type":"String","name":"Incident.CustomFields.c.gift_card_amount_new","custom":true,"constraints":{"maxLength":10},"mask":null,"readOnly":false,"contactToken":"ZlVRRFhibHhQSWRTMXFISG9LbGF5fl9HSzlVZ25aVlV0dzR4SUlWZkpqZXJObXNadHFrMGdEaWNhR2xjU3JSM3ZpcGZicElOcVBBOE93VExsbE1MMUZiaE40OVpiNVg1NVlpd1ZUT0k5bm40VVdzMmJ1VEtrVXZBQm9HYW1FbjRudlZEdmV2UGRxQ0FZIQ!!"}},'W10=','fUzRQC7vtD6TbfE82EuMUIoW528OxTj8SBVHICUp4R3DMuO9_HTyPeZTUTCuS3qVEz72MV1B7xFyW4wHKkx3Sl3orUTvW5TpVFPI9nneKYyymtR7hFAeKwjsSzd1dP0qLR_yGzpNI0o9k!',1502382271,'TextInput_31','custom/input/TextInput','Custom.Widgets.input.TextInput','31'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":33},"a":{"placeholder_text":" ","label_input":"Gift Card - New Card #","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_new_card","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text","table":"Incident"},"j":{"type":"String","name":"Incident.CustomFields.c.gift_card_new_card","custom":true,"constraints":{"maxLength":19},"mask":"M#M#M#M#M#M#M#M#M#M#M#M#M#M#M#M#M#M#M#","readOnly":false,"contactToken":"ZlVudDhFMUFGUXFYQWxmaFpOVk1rZTgwSFhrQkhWWG96TUxidWdEaFlvVWdtRDVuZWJJcVh6WUwxX1RuX09yS1Z2QU80QUk5SXR1NjlOUEo3fmd3ZjN0Z2M3U3M1c3FyTXpXTVVraHAxSWQ0a3RNZ3Zvc3RHU25KZnlHYkx4QUI3TWdHVEthUkNNcGNzIQ!!"}},'W10=','fUknC8Pzv4Ipn2JyJnCKugojOgJ8__NUSKTAMuZYKyYt4KA1z04qTZsH3fTw175grBrRY8FHkpgYpxYLUUKeU7SdphCCdhJnA7Y6ctGzr2SEbbJHfjc8As9VH23Zpz6t78OErE2waHTYI!',1502382271,'TextInput_33','custom/input/TextInput','Custom.Widgets.input.TextInput','33'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":35},"a":{"placeholder_text":" ","label_input":"Gift Card Box #","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_box_number","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text","table":"Incident"},"j":{"type":"String","name":"Incident.CustomFields.c.gift_card_box_number","custom":true,"constraints":{"maxLength":20},"mask":null,"readOnly":false,"contactToken":"ZlVzen5Fd3NUQ3FOc18yc2VGfmdhcWpCOWR2UlNIWVRwaGYwb2dvMnpGS3pNVmhMd0dRbV9BUndueGkxODFjYWV2ektJR2VYOGhrQlNTdDFadGtjb1paYThEREFLbElDalVzVGVqMmw1SkxNS0NzbXpzdUJYNTRsVHJsYlVweTExZ1ZrcUEwTkhYdWVnIQ!!"}},'W10=','fUmvLb_CfLeaOn5sZnwB~d8u2A0C8bvu6mMPARFIToXMigKUvefYpMHFx~0SpYORK_SOy7Zqh6XULMyJ0tY9VGzJ0hBRWs5~uh5RetMeQjvyOz0sZRwtJ_1i1KLXCQBlgKQ2BHsqAQUZU!',1502382272,'TextInput_35','custom/input/TextInput','Custom.Widgets.input.TextInput','35'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":37},"a":{"placeholder_text":" ","label_input":"Gift Card Amount (frozen)","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_frozen_amount","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text","table":"Incident"},"j":{"type":"String","name":"Incident.CustomFields.c.gift_card_frozen_amount","custom":true,"constraints":{"maxLength":10},"mask":null,"readOnly":false,"contactToken":"ZlVCSkFXNEkzOWp5TUhpa1dfUEVOYlpfVzJSdWNDOFBGbUNsQWxscWoxNHJzMGpyUWp4QWF2VUZQNWlFY3BWbXR6aDhPVWE1c2xFZjROMkd6MVhjWGZUZHNnX01XTmhXRDdWa2pvandXeXAyVnVvTHpfWHVicnlHbW9QX0VuXzQ0R0htZzE4QXVUMkZjIQ!!"}},'W10=','fU2WmtBi5lnojhZ0PMevBG8XHXfDLpm708Yao7_ZN4MD_4lS6Yh3IKzXhJLCljJi8sWKgnc9eFLVKSIhRMH5lRKDe2NOwhLawafmXk6a0bvYNiz7LRUn5Gz7BeKrFnqIainRjda7Gtp8w!',1502382272,'TextInput_37','custom/input/TextInput','Custom.Widgets.input.TextInput','37'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":39},"a":{"placeholder_text":" ","label_input":"Gift Card Frozen Card #","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_frozen_card_number","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text","table":"Incident"},"j":{"type":"String","name":"Incident.CustomFields.c.gift_card_frozen_card_number","custom":true,"constraints":{"maxLength":19},"mask":"M#M#M#M#M#M#M#M#M#M#M#M#M#M#M#M#M#M#M#","readOnly":false,"contactToken":"ZlV0azMwd1BtajFWfng1SG05dXRtX0dzbFZQVFF_SVlWWkhXMk1LNWIyZWkyeFN0UjhHNTJTSG1qSmN5ZnNucmhHQmw1UlBmc0JRWWprbFRyV2RDOG05T3c4cUc2YThGQ2E3aFZpaXlCNTFhc1FYQVdZWjhvX1FJbWFKd2VkRGl6U3RlMzdPWlBYRFhRIQ!!"}},'W10=','fUcj8dkiaojgSbvvKQt_SMPFCFYxXrKDmhKOFVELy4nyi8CoIGyjTPoUoCjAsbgSz1QX0ZO60WitfHE8J5ILbE7Hvd9jQnHOSSzcauRi7bNgRBgO8mDKtt_rRRiZTbzNs7UyclwPv7uVg!',1502382272,'TextInput_39','custom/input/TextInput','Custom.Widgets.input.TextInput','39'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":41},"a":{"placeholder_text":" ","label_input":"Gift Card Issuing Location","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.gift_card_issuing_location","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text","table":"Incident"},"j":{"type":"String","name":"Incident.CustomFields.c.gift_card_issuing_location","custom":true,"constraints":{"maxLength":30},"mask":null,"readOnly":false,"contactToken":"ZlV4R0hKWW45T0RpUW05enBJdFRVcUl_NnJ3b1JrYlFLejdQY2F4S2VTRDlHblNLNjVpWUZDY1dqT1hvdFNXUEdaZHNXZHBkUmNPQlZBU0luSTYzTWdoTTNpS1lwQmlETFF_QWRfTFd2em55NnNqUFY0blh3enRnSTRMZ2lsWXI3emVta1VqSGlUOWQ4IQ!!"}},'W10=','fUL5aU_PdMngoMM7Nc3CsTqSFseAAxk8hKGlnBITaaU5HsDFLEEaLy1FXvfJB1Pbr4l9k98f5GgicA06AUaRU78~KK7i~H4uiti9uA2VSyriUMSkMq5EHdECGtO5dTQgkTR4u~fJ8vDdE!',1502382272,'TextInput_41','custom/input/TextInput','Custom.Widgets.input.TextInput','41'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":43},"a":{"label_input":"Chat Topic","label_required":"%s is required","name":"Incident.CustomFields.c.chat_type","required":false,"hint":"Please select the Chat topic that best fits the issue","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"NamedIDLabel","name":"Incident.CustomFields.c.chat_type","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fULN2Ww2MAwSQII6Ld6jNSmYLT8axgFL0450llehzzDZxXfbpEL_O8R_awRIpO2IY7~7jSg3TKlpl6k1WMzxE58EnS6cEUtS7yTciYx3YQ4jTZ6WlTxh4MJrzfOskOcQlQO1pNivO64pQ!',1502382272,'SelectionInput_43','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','43'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":45},"a":{"placeholder_text":" ","label_input":"last 4 digits","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.last_4_digits","required":false,"hint":"Enter the last 4 digits of the customer's credit card","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text","table":"Incident"},"j":{"type":"String","name":"Incident.CustomFields.c.last_4_digits","custom":true,"constraints":{"maxLength":4},"mask":"M#M#M#M#","readOnly":false,"contactToken":"ZlVWMmdENm5Zb1ZEcEFlVUpIcTNlbl9qU0wwTzd_OVpFQ1A0YTVWcUk3cmtDU0Z3NHlZakdjdzdsdTMwa2xEdlVxdlhYMEMwdno3M2lnVlF_OFdFNUpIMl9Cblc2cGpvWFNoWE9WSkdYaTh1ZWF4MFp6ZTI3T2x0TTRPOTBsb0g0c2l_bVVzVV9rcnVJIQ!!"}},'W10=','fUlh84~wlWCUn6s7t20MUPHNDtQZxeKkNyxRBHMkhcYb9DFQRELQpMxVqj4IAHzCvT5L6ooXgV27vRKazHMg5friTxSdxgYp5XX7~5fVUMRqve6M4XAM53FgFbDpCijZ5PwSHQEHYgiyo!',1502382272,'TextInput_45','custom/input/TextInput','Custom.Widgets.input.TextInput','45'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":47},"a":{"label_input":"Which location did you visit?","label_required":"%s is required","name":"Incident.CustomFields.c.pertains_to_cafe","required":false,"hint":"Does your question or comment pertain to a specific bakery-cafe? If it does, please select this option so we can be sure we are addressing the correct bakery-cafe.","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"Boolean","name":"Incident.CustomFields.c.pertains_to_cafe","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUQDTj0X2z6aDYQ9hLxW9qYsyOWAtqj~vpKe1iCHgQV0AwI5LBM9FtHJkf7Z3GP9hblLeQQ6zAlZqcDvx7_xz4uH54mU65I~jX~LRMM2TjP8fq9L~SSCBhmfHIyBfJuW1w_Hg0g3HQkOQ!',1502382272,'SelectionInput_47','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','47'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":49},"a":{"label_input":"Send to Franchise","label_required":"%s is required","name":"Incident.CustomFields.c.send_to_franchise","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"Boolean","name":"Incident.CustomFields.c.send_to_franchise","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fU6qHZMFKb3qSAeRNLI_MXr~9mpkpNGiaV2Itux9kPm6jhpXSPqe_LfQ5miQzn1xrh8dLSI4JGPXajYQs~sO6IPK2Q8PI6WxajycSJr~xUxgjHARBxGffpjxJrUPaYKpVJ9br6Gy5Cs6Q!',1502382272,'SelectionInput_49','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','49'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":51},"a":{"label_input":"Order Cancellation","label_required":"%s is required","name":"Incident.CustomFields.c.order_cancellation","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"Boolean","name":"Incident.CustomFields.c.order_cancellation","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUItTHmuqrxn4HELAs5X4QX6yi8ZiXXMwgEAOxkoEMx~J2YyTscXypNqjpN_8~TqKj6VYMtiG_rM03FdlUjbKDjcdxViOdThn_bQAiudEQhGfsDDnfdXbDWCUgVQnr1yhCACbKxtMJYiY!',1502382272,'SelectionInput_51','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','51'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":53},"a":{"label_input":"Workspace selection","label_required":"%s is required","name":"Incident.CustomFields.c.admin_workspace_selection","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"NamedIDLabel","name":"Incident.CustomFields.c.admin_workspace_selection","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUzkUX~jsOyoxNwrdNDjFjOgdWIMHPwO7s9_2DJsmXVO5PZmZOzqMJnvu2om9zczr0bWWoKttmH0y2x6EDSqElOhJY2NnMK6pa55YAbUkVPDqdC4YLu9w6c6uZ4kpPR4SSvkPX6riR7Kc!',1502382272,'SelectionInput_53','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','53'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":55},"a":{"label_input":"Reason for Refund v2","label_required":"%s is required","name":"Incident.CustomFields.c.esc_reasonforrefund","required":false,"hint":"Reason for providing the guest a refund.","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"NamedIDLabel","name":"Incident.CustomFields.c.esc_reasonforrefund","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUfyZw2rq9sfsFfD2zYuUL~gXCcIERfZtgPRA25mqjHY2j~4Oeg~1ItikTG6DM~9Lqwpk3MNpMlxf6MNfvl7SEoJsujMd3q36vdiN4W8WPz8M6AvDNxdhzkQQ1GVx9NjbQWnDnBrrWBEg!',1502382272,'SelectionInput_55','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','55'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":57},"a":{"label_input":"Payment Method","label_required":"%s is required","name":"Incident.CustomFields.c.esc_paymentmethod","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"NamedIDLabel","name":"Incident.CustomFields.c.esc_paymentmethod","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUqvJ0AUPQCKOt7xx6DeXx35EiBaerCPOhCcH2J3OTVXcWbhp7M1goLifTq3ptXInNS7obqDY9OhT8sdh~3XWXH72mQtVG7Q4IWxOaHBepzjspRfdCM2wLvi7Rp_HieOHS27T1LzwHvRI!',1502382272,'SelectionInput_57','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','57'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":59},"a":{"label_input":"Email Opt In","label_required":"%s is required","name":"Incident.CustomFields.c.email_opt_in","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"Boolean","name":"Incident.CustomFields.c.email_opt_in","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUzCjleWIXk5vhWOU8ONNOjeiLVN5kRq2CMtZpnRD~oqB08hJjwL4KxGDcn6D8JxBYLHQfay7jZIsQ3IkxkYHkWBLm4c4BtkmHFcYwrS1ls5mnZAMKknM~aELWZMpcaTPBP5PgYoaTdqA!',1502382272,'SelectionInput_59','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','59'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":61},"a":{"label_input":"Franchise Forward","label_required":"%s is required","name":"Incident.CustomFields.c.franchise_forward","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":false,"read_only":false,"sub_id":"selection","table":"Incident","always_show_mask":"false"},"j":{"type":"Boolean","name":"Incident.CustomFields.c.franchise_forward","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fU7ruU8kLZz_rWxumGLbeQKcff8d4PbdBP3zzVorgIlixymUXCfk1twIRTAnOVCICIo0xfunxqFMQc_Pa5vn1Xz6sGV3kY0TRIbwQzcO~zOuW0motfNWcLFpDjLazTcZQJ70Q5K158~QE!',1502382272,'SelectionInput_61','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','61'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":63},"a":{"placeholder_text":" ","label_input":"Pass Through Text Area","label_error":"","label_required":"%s is required","name":"Incident.CustomFields.c.passthrough_textarea","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text","table":"Incident"},"j":{"type":"String","name":"Incident.CustomFields.c.passthrough_textarea","custom":true,"constraints":{"maxLength":4000},"mask":null,"readOnly":false,"contactToken":"ZlVDd0k2TEVrUFFGdk9ZbEVSSFRQaThfMGMxdEExSko3QUFic1pHQmVxZG9OQ1REdFpSV2VSQk1hcEpENzB0YVlPV01_WmdaZDljVWd6RzFCcF90VE1uYXU3ZnE1dG1YZmJxQTd2MzR3aWJXTmtZMG45ZXBsNUZMbGhoTzhtRHdmdThvVjg1Z1pNS3pnIQ!!"}},'W10=','fUi2DiNdXdvro9csaq05Kw2B2wa_cy1WYEwYM3n1pxGyFAG0sZGfLUWjCqsdk2QzV_dtgOfzt6f_OLEPk28u2pnINlZ2t9OMBHqR1A70Fo8KnBhs0t8WtVjj2_xLuFZuZcqnroideq~3E!',1502382272,'TextInput_63','custom/input/TextInput','Custom.Widgets.input.TextInput','63'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":65},"a":{"placeholder_text":" ","label_input":"Subject","label_error":"","label_required":"%s is required","name":"Incident.Subject","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":true,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text"},"j":{"type":"String","name":"Incident.Subject","custom":false,"constraints":{"maxLength":240},"mask":null,"readOnly":false,"contactToken":"ZlV3dU51OUw0YWdHdWZhNTF1elJmenZFRH4wS0dLfjlQc3RkMlZVcFFWcjRiR1ZOVko0QTBEZ0VWSlZnTzZxfmZOYnlITnJhRDFJMlYwZE9BdWV5S0NxMnZWQkZTbVRNZkx2b3JsYzZXamdUcVNRd2ttb3hsaUR5Vn44aU1EYW9HWFZYd1lZWTdYaDVjIQ!!"}},'W10=','fUTZ6t6PkkvehQH1JFt53QKzjC6Hom~2WKqWLJXuoPUjl~PW7p8BuTVzKhwx8aMpcCYS5c3xmWjgGtVM0X9fYLrmlna3HmGgcoo0JZnIcCS1mkwF~hEyZ2CRIyVG2G60v0rV948qNdwck!',1502382272,'TextInput_65','custom/input/TextInput','Custom.Widgets.input.TextInput','65'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":66},"a":{"placeholder_text":" ","label_input":"First Name","label_error":"","label_required":"%s is required","name":"Contact.Name.First","required":true,"hint":"","always_show_hint":false,"initial_focus":true,"validate_on_blur":false,"always_show_mask":true,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false},"j":{"type":"String","name":"Contact.Name.First","custom":false,"constraints":{"regex":"^[^\n]*$","maxLength":80},"readOnly":false,"contactToken":"ZlVHRXN5cGpBU3VWN25WdWtIMGlLN1BJZDhOOVN1dFo0QlFlUE13YjdUOUZ_X3kxbkN3SUNOVmplRkNkc0hwNmVnSnBzUm9neTFaa35_aVVzYmhSekllQloxRmdOQ1JYUkVrcldKYkJWeUtOfmNCOF8yc0JmSjVaTUJ5U1dwODl6dVB2X21fVXdHWEtZIQ!!"}},'W10=','fUNqVKJT5Eu0QuGA2IapkB~p9Lpij60fa5gmvyyPv~1uPqqg~7_55pEYqWl46eeO2AYVIEokcGL_WJfmuWFD4Z5sZqWkHgvpCEFapeZhTY3w5bu6Wf7~M~ZFhLY69l4RzRuAvIJONauyI!',1502382272,'TextInput_66','custom/input/TextInput','Custom.Widgets.input.TextInput','66'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":68},"a":{"placeholder_text":" ","label_input":"Last Name","label_error":"","label_required":"%s is required","name":"Contact.Name.Last","required":true,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":true,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text"},"j":{"type":"String","name":"Contact.Name.Last","custom":false,"constraints":{"regex":"^[^\n]*$","maxLength":80},"mask":null,"readOnly":false,"contactToken":"ZlVoNkZ6bUh3VFVkaGtQRHVpfnNfZlkxM0ZhV2RiczlzcWF5Z1l1NGJpX3F5MEJVN25uQmpNYzhPMVpNaUNyS2d3fjd4ZklVbW5WRWRCWFZYTEhrX0NnYXhZdVdNRUZoNmVrZ2t6Z0gwRn4zdE5jfkd3bH4yd2sxRGxXVG9OUGVuRjhzdFo3TUFWbkpRIQ!!"}},'W10=','fU33Or4UzDJD46ZXyNNiPrtW7buIOaxqL5n0Npr_qzVXcIvrBupMJvxKf3mIN5yFQG8YW2PZD2gZOG17IYBjE_xtZoXuXKsFscFktV2hx4k5L0rUbKEqWTXHp5v6yzmTxeYtO9zkMK7eE!',1502382272,'TextInput_68','custom/input/TextInput','Custom.Widgets.input.TextInput','68'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":70},"a":{"placeholder_text":" ","label_input":"Email Address","label_error":"","label_required":"%s is required","name":"Contact.Emails.PRIMARY.Address","required":true,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":true,"default_value":"%EMPTY%","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text"},"j":{"type":"String","name":"Contact.Emails.PRIMARY.Address","custom":false,"constraints":{"regex":"^((([-_!#$%&'*+\/=?^~`{|}\\w]+([.][-_!#$%&'*+\/=?^~`{|}\\w]*)*)|(\"[^\"]+\"))@[0-9A-Za-z]+([\\-]+[0-9A-Za-z]+)*(\\.[0-9A-Za-z]+([\\-]+[0-9A-Za-z]+)*)+[;, ]*)+$","maxLength":80},"mask":null,"readOnly":false,"contactToken":"ZlVfRG1TX0NGRkwzRVE1VFVHR3BvaTZoUzNZQjdvUVBqOUl6cDAzWnI4MDFZU09rd1R6NzhFb341UDZaWEd1Y1RTVjJOWH5uVjlFbjVzdnoxT0ZQVXpjNk8wZWphZWNaTm5lQnBxOGI5ekZZdm5rUTNjak5EbmpmbGF0a0oyVFhSNHJGfk1CaXc0dX40IQ!!"}},'W10=','fU5~sIzziZFNU38Mp6lALdQZFYvmcdOWBaj2L41zgNLBjjwarGFPbpJgt1WEKlKJF_1ZhXW2bqQjLvsV4DWGlSVD8lEjNeTKreWb5WeL60DE0teHCcAvH2XQZbujyO8tHQ6uyQYWLP3LA!',1502382272,'TextInput_70','custom/input/TextInput','Custom.Widgets.input.TextInput','70'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":72},"a":{"placeholder_text":" ","label_input":"Phone Number","label_error":"","label_required":"%s is required","name":"Contact.Phones.HOME.Number","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":true,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text"},"j":{"type":"String","name":"Contact.Phones.HOME.Number","custom":false,"constraints":{"regex":"^[\\]\\[+0-9a-zA-Z \\t.,()#-\/]*$","maxLength":40},"mask":null,"readOnly":false,"contactToken":"ZlVGb1Z6SlRBb3JjSGtWWHV4YjhVb3JQc0R3QWt0WHJyd0ZldjZwdUhoRTllVjhtMDdXWkpEV0dMOFJDTnNTVnp_aEpRNUFQdExBTUtFaW9XVFFZVnhha0dxcE1OSkhaV01HRV92MXN3bFRjZFpZeXNUaX55dVhoRjZpSEw3X1cxNVhuTU9MVE53SjlnIQ!!"}},'W10=','fUGtKBMuRELAhE_QyLjflyWkMg_JGB7ifxFYInmSzBKwsqXRUGXdgKAHMZbz2J2Ng0VCg~LbtbK~PnnjPP6meavIFj~5yQ5rOPuCzWXY~6mQsGsnvfSsatjVwmSbQBLFhTAuFWLubSQ_M!',1502382272,'TextInput_72','custom/input/TextInput','Custom.Widgets.input.TextInput','72'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":74},"a":{"placeholder_text":" ","label_input":"MyPanera Card Number","label_error":"","label_required":"%s is required","name":"Contact.CustomFields.c.panera_my_panera_number","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":true,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":0,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false,"sub_id":"text"},"j":{"type":"String","name":"Contact.CustomFields.c.panera_my_panera_number","custom":true,"constraints":{"maxLength":13},"mask":null,"readOnly":false,"contactToken":"ZlV6dVFaMkJHUHRMdERfcG9QZWl_VFE1Z0FBZjQyclFoMzg3dVZEQVdxbUFZT2REa09NTUdaSEJUNnBfYnM2WGVVcUJsdVRzZWNxcFJQTFZmNFNjaDJOV3BYeDhwTjBJUXpDWGxtUkpJME9rVlFyN2w4Z3RUdWVnR012OTEyVzhjRmx2dVlVVndhUk93IQ!!"}},'W10=','fUGLqJwdg4SS3OhOLn526P8ZVfhkCwwVmBbGh4iX9hywXtgnMy1NpxLcR55Id0xpuYkppecyWi~kS0NvLHL1JUbmWt4qxER9FpSc11fedj8cbs9~SckxFv7Y6gdp0OZdePaVogJ3~kbNk!',1502382272,'TextInput_74','custom/input/TextInput','Custom.Widgets.input.TextInput','74'); +W[c]({"i":{"c":"ProductCategoryInput","n":"ProductCategoryInput","w":75},"a":{"default_value":"","label_all_values":"----------","label_input":"Select the option that best describes why you're contacting us.","label_error":"","label_set_button":"Products","label_required":"Please select an item under %s","label_not_permissioned":"You do not have permission to select %s. Please select a different item.","label_selection_not_valid":"%s is not a valid selection","label_confirm_button":"OK","label_cancel_button":"Cancel","label_nothing_selected":"Options","label_accessible_interface":"This button does not work with screen readers. Please use the previous link instead.","label_screen_reader_selected":"Values selected:","label_screen_reader_accessible_option":"Screen Reader users press enter to select a %s.","verify_permissions":"None","name":"Incident.Product","label_level":"Level","required_lvl":1,"max_lvl":2,"linking_off":false,"set_button":false,"allow_external_login_updates":false,"show_confirm_button_in_dialog":false,"hint":"","always_show_hint":false,"hide_on_load":false},"j":{"type":"ServiceProduct","name":"Incident.Product","custom":false,"constraints":[],"table":"Incident","data_type":"Product","permissionedProdcatIds":[],"permissionedProdcatList":[],"readableProdcatIdsWithChildren":[],"readableProdcatIds":[],"linkingOn":1,"hm_type":13,"hierData":[[{"id":0,"label":"----------"},{"id":685,"label":"Online Ordering Application Support","hasChildren":true,"selected":false},{"id":475,"label":"My Experience","hasChildren":true,"selected":false},{"id":698,"label":"MyPanera","hasChildren":false,"selected":false},{"id":1016,"label":"MyPanera Catering Rewards","hasChildren":false,"selected":false},{"id":699,"label":"Panera Bread Gift Cards","hasChildren":false,"selected":false},{"id":700,"label":"Panera at Home Grocery Products","hasChildren":true,"selected":false},{"id":941,"label":"Who We Are","hasChildren":false,"selected":false},{"id":701,"label":"All Other Inquiries","hasChildren":false,"selected":false}]]}},'W10=','fU9HpvxI9samCkzZFs4lAbN54611oAXreMYV5jiT9sT5IkVtRP0C_BGBBps~87_G6MDq9Y~AxN5nUgMdiT576b16Xs4oF2OHI7S6GrfSWLI3rs~bMfYVWZ6I4uAYIQBhiiyo7iON~GJqo!',1502382272,'ProductCategoryInput_75','standard/input/ProductCategoryInput','RightNow.Widgets.ProductCategoryInput','75'); +W[c]({"i":{"c":"ProductCategoryInput","n":"ProductCategoryInput","w":76},"a":{"default_value":"","label_all_values":"----------","label_input":"Please share a bit more detail. This will help us assist you more quickly.","label_error":"","label_set_button":"Products","label_required":"Please select an item under %s","label_not_permissioned":"You do not have permission to select %s. Please select a different item.","label_selection_not_valid":"%s is not a valid selection","label_confirm_button":"OK","label_cancel_button":"Cancel","label_nothing_selected":"Details","label_accessible_interface":"This button does not work with screen readers. Please use the previous link instead.","label_screen_reader_selected":"Values selected:","label_screen_reader_accessible_option":"Screen Reader users press enter to select a %s.","verify_permissions":"None","name":"Incident.Category","label_level":"Level","required_lvl":1,"max_lvl":1,"linking_off":false,"set_button":false,"allow_external_login_updates":false,"show_confirm_button_in_dialog":false,"hint":"","always_show_hint":false,"hide_on_load":false},"j":{"type":"ServiceCategory","name":"Incident.Category","custom":false,"constraints":[],"table":"Incident","data_type":"Category","permissionedProdcatIds":[],"permissionedProdcatList":[],"readableProdcatIdsWithChildren":[],"readableProdcatIds":[],"linkingOn":1,"hm_type":14,"link_map":[[{"id":0,"label":"----------"},{"id":337,"label":"Cafe Environment","hasChildren":false,"selected":false},{"id":329,"label":"Product","hasChildren":false,"selected":false},{"id":320,"label":"Service","hasChildren":false,"selected":false},{"id":363,"label":"Edit My Info","hasChildren":false,"selected":false},{"id":372,"label":"Lost Card","hasChildren":false,"selected":false},{"id":377,"label":"Registration","hasChildren":false,"selected":false},{"id":385,"label":"Rewards","hasChildren":false,"selected":false},{"id":368,"label":"Login","hasChildren":false,"selected":false},{"id":1481,"label":"eGift Cards - PIN","hasChildren":false,"selected":false},{"id":403,"label":"eGift Cards - No PIN","hasChildren":false,"selected":false},{"id":1482,"label":"Plastic Gift Cards - PIN","hasChildren":false,"selected":false},{"id":408,"label":"Plastic Gift Cards - No PIN","hasChildren":false,"selected":false},{"id":1096,"label":"Questions and Feedback","hasChildren":false,"selected":false},{"id":961,"label":"Animal Welfare","hasChildren":false,"selected":false},{"id":439,"label":"Donation Requests","hasChildren":false,"selected":false},{"id":963,"label":"Food Policy","hasChildren":false,"selected":false},{"id":445,"label":"Nutrition","hasChildren":false,"selected":false},{"id":962,"label":"Responsibility","hasChildren":false,"selected":false},{"id":925,"label":"Investor Relations","hasChildren":false,"selected":false},{"id":583,"label":"Suggestions for Improvements","hasChildren":false,"selected":false},{"id":358,"label":"Placing an Order","hasChildren":false,"selected":false},{"id":658,"label":"Technical Support","hasChildren":false,"selected":false},{"id":621,"label":"All Other Questions","hasChildren":false,"selected":false},{"id":361,"label":"Other","hasChildren":false,"selected":false},{"id":1207,"label":"Location Selection","hasChildren":false,"selected":false},{"id":1208,"label":"Time and Date Selection","hasChildren":false,"selected":false},{"id":1209,"label":"Menu Selection\/Customization","hasChildren":false,"selected":false},{"id":1210,"label":"Check Out Page","hasChildren":false,"selected":false},{"id":1211,"label":"Confirmation Page","hasChildren":false,"selected":false},{"id":1214,"label":"Favorite Order","hasChildren":false,"selected":false},{"id":1215,"label":"Past Order","hasChildren":false,"selected":false},{"id":1216,"label":"Sign In Page","hasChildren":false,"selected":false}]],"hierDataNone":[[{"id":0,"label":"----------"},{"id":337,"label":"Cafe Environment","hasChildren":false,"selected":false},{"id":329,"label":"Product","hasChildren":false,"selected":false},{"id":320,"label":"Service","hasChildren":false,"selected":false},{"id":363,"label":"Edit My Info","hasChildren":false,"selected":false},{"id":372,"label":"Lost Card","hasChildren":false,"selected":false},{"id":377,"label":"Registration","hasChildren":false,"selected":false},{"id":385,"label":"Rewards","hasChildren":false,"selected":false},{"id":368,"label":"Login","hasChildren":false,"selected":false},{"id":1481,"label":"eGift Cards - PIN","hasChildren":false,"selected":false},{"id":403,"label":"eGift Cards - No PIN","hasChildren":false,"selected":false},{"id":1482,"label":"Plastic Gift Cards - PIN","hasChildren":false,"selected":false},{"id":408,"label":"Plastic Gift Cards - No PIN","hasChildren":false,"selected":false},{"id":1096,"label":"Questions and Feedback","hasChildren":false,"selected":false},{"id":961,"label":"Animal Welfare","hasChildren":false,"selected":false},{"id":439,"label":"Donation Requests","hasChildren":false,"selected":false},{"id":963,"label":"Food Policy","hasChildren":false,"selected":false},{"id":445,"label":"Nutrition","hasChildren":false,"selected":false},{"id":962,"label":"Responsibility","hasChildren":false,"selected":false},{"id":925,"label":"Investor Relations","hasChildren":false,"selected":false},{"id":583,"label":"Suggestions for Improvements","hasChildren":false,"selected":false},{"id":358,"label":"Placing an Order","hasChildren":false,"selected":false},{"id":658,"label":"Technical Support","hasChildren":false,"selected":false},{"id":621,"label":"All Other Questions","hasChildren":false,"selected":false},{"id":361,"label":"Other","hasChildren":false,"selected":false},{"id":1207,"label":"Location Selection","hasChildren":false,"selected":false},{"id":1208,"label":"Time and Date Selection","hasChildren":false,"selected":false},{"id":1209,"label":"Menu Selection\/Customization","hasChildren":false,"selected":false},{"id":1210,"label":"Check Out Page","hasChildren":false,"selected":false},{"id":1211,"label":"Confirmation Page","hasChildren":false,"selected":false},{"id":1214,"label":"Favorite Order","hasChildren":false,"selected":false},{"id":1215,"label":"Past Order","hasChildren":false,"selected":false},{"id":1216,"label":"Sign In Page","hasChildren":false,"selected":false}]],"hierData":[[{"id":0,"label":"----------"},{"id":337,"label":"Cafe Environment","hasChildren":false,"selected":false},{"id":329,"label":"Product","hasChildren":false,"selected":false},{"id":320,"label":"Service","hasChildren":false,"selected":false},{"id":363,"label":"Edit My Info","hasChildren":false,"selected":false},{"id":372,"label":"Lost Card","hasChildren":false,"selected":false},{"id":377,"label":"Registration","hasChildren":false,"selected":false},{"id":385,"label":"Rewards","hasChildren":false,"selected":false},{"id":368,"label":"Login","hasChildren":false,"selected":false},{"id":1481,"label":"eGift Cards - PIN","hasChildren":false,"selected":false},{"id":403,"label":"eGift Cards - No PIN","hasChildren":false,"selected":false},{"id":1482,"label":"Plastic Gift Cards - PIN","hasChildren":false,"selected":false},{"id":408,"label":"Plastic Gift Cards - No PIN","hasChildren":false,"selected":false},{"id":1096,"label":"Questions and Feedback","hasChildren":false,"selected":false},{"id":961,"label":"Animal Welfare","hasChildren":false,"selected":false},{"id":439,"label":"Donation Requests","hasChildren":false,"selected":false},{"id":963,"label":"Food Policy","hasChildren":false,"selected":false},{"id":445,"label":"Nutrition","hasChildren":false,"selected":false},{"id":962,"label":"Responsibility","hasChildren":false,"selected":false},{"id":925,"label":"Investor Relations","hasChildren":false,"selected":false},{"id":583,"label":"Suggestions for Improvements","hasChildren":false,"selected":false},{"id":358,"label":"Placing an Order","hasChildren":false,"selected":false},{"id":658,"label":"Technical Support","hasChildren":false,"selected":false},{"id":621,"label":"All Other Questions","hasChildren":false,"selected":false},{"id":361,"label":"Other","hasChildren":false,"selected":false},{"id":1207,"label":"Location Selection","hasChildren":false,"selected":false},{"id":1208,"label":"Time and Date Selection","hasChildren":false,"selected":false},{"id":1209,"label":"Menu Selection\/Customization","hasChildren":false,"selected":false},{"id":1210,"label":"Check Out Page","hasChildren":false,"selected":false},{"id":1211,"label":"Confirmation Page","hasChildren":false,"selected":false},{"id":1214,"label":"Favorite Order","hasChildren":false,"selected":false},{"id":1215,"label":"Past Order","hasChildren":false,"selected":false},{"id":1216,"label":"Sign In Page","hasChildren":false,"selected":false}]]}},'W10=','fUXExl9tcZP2WDytfJ5Fs_qzdT0blLctbr1rwT~Jhnx4lbVRf5KObm~B40KbmV1pPeQLF4zv2Ch8qVK2SbMp5onI3ENXApYAB0La1FyE6Egjre93_N0uhdpcO~sAEM~G9SKF5aSE9xHxM!',1502382272,'ProductCategoryInput_76','standard/input/ProductCategoryInput','RightNow.Widgets.ProductCategoryInput','76'); +W[c]({"i":{"c":"AskAQuestion","n":"AskAQuestion","w":77},"a":{"dyn_cat_to_mypanera_phone":"","dyn_cat_to_pertains_to_cafe":"475,696,697","prod_checks_cafe":"698,1016,699,701","prod_unchecks_cafe":"685,691,692,703,694,1124,695,700,951,953,952,1132,955,1273,954,950,1286,941","prod_requires_cafe":"475,696,697,1334","cat_checks_cafe":"","cat_unchecks_cafe":"925","cat_requires_cafe":""},"j":[]},'W10=','fU~QXVzxbO_vaHz8l2xy1HAp5NU5DJUMrRvseTGaoKnWP~8NvFewGB~prY6ZUrPHAlS6Bv~kWDJigcx80kRUbTl1bJ1wZTgYXxiBoIoPnLPndXEURzsxnc0Rwap6cAQ1sgYa50MCP5Liw!',1502382272,'AskAQuestion_77','custom/forms/AskAQuestion','Custom.Widgets.forms.AskAQuestion','77'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":79},"a":{"label_input":"Does your question pertain to a specific bakery-cafe?","label_required":"%s is required","name":"Incident.CustomFields.c.pertains_to_cafe","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":true,"display_as_checkbox":true,"hide_on_load":false,"read_only":false,"sub_id":"selection","prod_unchecks_cafe":"685,691,692,703,694,1124,695,700,951,953,952,1132,955,1273,954,950,1286,941","prod_requires_cafe":"475,696,697,1334","dyn_cat_to_pertains_to_cafe":"475,696,697","prod_checks_cafe":"698,1016,699,701","dyn_cat_to_mypanera_phone":"","cat_requires_cafe":"","cat_unchecks_cafe":"925","cat_checks_cafe":""},"j":{"type":"Boolean","name":"Incident.CustomFields.c.pertains_to_cafe","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUnoudas0hvjnJBc7~nxPd_xQVfrbN6Bn_eKUt6KzbuATyu5bh2OFSWYoIP91LbqQ1EgiAWlR2OdrpKXoC93QvRMwpIgQKf6ozDkQwxMXDAd071MgpJird~_mfiLURsb6jEv318KWa9Gc!',1502382272,'SelectionInput_79','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','79'); +W[c]({"i":{"c":"HierarchyInput","n":"HierarchyInput","w":80},"a":{"watch_field_name":"","label_nothing_selected":"State","lookup_query":"SELECT ID as Value, StateName as Label FROM CafeInfo.CafeState ORDER BY StateName ASC","ajax_value_lookup_endpoint":"\/ci\/ajax\/widget\/custom\/input\/HierarchyInput\/handleLookupFromAjax","label_input":"","label_required":"%s is required","name":"Z.CafeInfo.CafeState.ID","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":true,"read_only":false,"cat_checks_cafe":"","cat_unchecks_cafe":"925","cat_requires_cafe":"","prod_requires_cafe":"475,696,697,1334","prod_unchecks_cafe":"685,691,692,703,694,1124,695,700,951,953,952,1132,955,1273,954,950,1286,941","dyn_cat_to_pertains_to_cafe":"475,696,697","prod_checks_cafe":"698,1016,699,701","dyn_cat_to_mypanera_phone":""},"j":{"type":"Menu","name":"Z.CafeInfo.CafeState.ID","custom":false,"constraints":[]}},'eyJleHRlbmRzIjpbInN0YW5kYXJkXC9pbnB1dFwvU2VsZWN0aW9uSW5wdXQiXSwibm9uRGVmYXVsdEF0dHJWYWx1ZXMiOnsibGFiZWxfaW5wdXQiOiIiLCJsYWJlbF9ub3RoaW5nX3NlbGVjdGVkIjoiU3RhdGUiLCJoaWRlX29uX2xvYWQiOiJ0cnVlIiwicmVxdWlyZWQiOiJmYWxzZSIsIm5hbWUiOiJaLkNhZmVJbmZvLkNhZmVTdGF0ZS5JRCIsImxvb2t1cF9xdWVyeSI6IlNFTEVDVCBJRCBhcyBWYWx1ZSwgU3RhdGVOYW1lIGFzIExhYmVsIEZST00gQ2FmZUluZm8uQ2FmZVN0YXRlIE9SREVSIEJZIFN0YXRlTmFtZSBBU0MiLCJjYXRfY2hlY2tzX2NhZmUiOiIiLCJjYXRfdW5jaGVja3NfY2FmZSI6IjkyNSIsImNhdF9yZXF1aXJlc19jYWZlIjoiIiwicHJvZF9yZXF1aXJlc19jYWZlIjoiNDc1LDY5Niw2OTcsMTMzNCIsInByb2RfdW5jaGVja3NfY2FmZSI6IjY4NSw2OTEsNjkyLDcwMyw2OTQsMTEyNCw2OTUsNzAwLDk1MSw5NTMsOTUyLDExMzIsOTU1LDEyNzMsOTU0LDk1MCwxMjg2LDk0MSIsImR5bl9jYXRfdG9fcGVydGFpbnNfdG9fY2FmZSI6IjQ3NSw2OTYsNjk3IiwicHJvZF9jaGVja3NfY2FmZSI6IjY5OCwxMDE2LDY5OSw3MDEiLCJkeW5fY2F0X3RvX215cGFuZXJhX3Bob25lIjoiIn0sImNsaWNrc3RyZWFtIjp7ImhhbmRsZUxvb2t1cEZyb21BamF4IjoiY3VzdG9tX2FjdGlvbiJ9fQ==','fU2gAnqcqIcV4_IAEHY02HqP1THDJR3haarXrs5Ao_QJMrKEkZBuxYSrbPe9P5e1YA2uzJVATPIfWCJxQTOPxFCNApjbY1wDIKCyZ_j~mIItjI1Ivo2qNV3ZCH~mGNDEkZweLyXEOLvDI!',1502382272,'HierarchyInput_80','custom/input/HierarchyInput','Custom.Widgets.input.HierarchyInput','80'); +W[c]({"i":{"c":"HierarchyInput","n":"HierarchyInput","w":81},"a":{"watch_field_name":"Z.CafeInfo.CafeState.ID","label_nothing_selected":"City","lookup_query":"SELECT ID as Value, CityName as Label FROM CafeInfo.CafeCity WHERE CafeState = %d ORDER BY CityName ASC","ajax_value_lookup_endpoint":"\/ci\/ajax\/widget\/custom\/input\/HierarchyInput\/handleLookupFromAjax","label_input":"","label_required":"%s is required","name":"Z.CafeInfo.CafeCity.ID","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":true,"read_only":false,"cat_checks_cafe":"","cat_unchecks_cafe":"925","cat_requires_cafe":"","prod_requires_cafe":"475,696,697,1334","prod_unchecks_cafe":"685,691,692,703,694,1124,695,700,951,953,952,1132,955,1273,954,950,1286,941","dyn_cat_to_pertains_to_cafe":"475,696,697","prod_checks_cafe":"698,1016,699,701","dyn_cat_to_mypanera_phone":""},"j":{"type":"Menu","name":"Z.CafeInfo.CafeCity.ID","custom":false,"constraints":[]}},'eyJleHRlbmRzIjpbInN0YW5kYXJkXC9pbnB1dFwvU2VsZWN0aW9uSW5wdXQiXSwibm9uRGVmYXVsdEF0dHJWYWx1ZXMiOnsibGFiZWxfaW5wdXQiOiIiLCJsYWJlbF9ub3RoaW5nX3NlbGVjdGVkIjoiQ2l0eSIsIm5hbWUiOiJaLkNhZmVJbmZvLkNhZmVDaXR5LklEIiwiaGlkZV9vbl9sb2FkIjoidHJ1ZSIsInJlcXVpcmVkIjoiZmFsc2UiLCJ3YXRjaF9maWVsZF9uYW1lIjoiWi5DYWZlSW5mby5DYWZlU3RhdGUuSUQiLCJsb29rdXBfcXVlcnkiOiJTRUxFQ1QgSUQgYXMgVmFsdWUsIENpdHlOYW1lIGFzIExhYmVsIEZST00gQ2FmZUluZm8uQ2FmZUNpdHkgV0hFUkUgQ2FmZVN0YXRlID0gJWQgT1JERVIgQlkgQ2l0eU5hbWUgQVNDIiwiY2F0X2NoZWNrc19jYWZlIjoiIiwiY2F0X3VuY2hlY2tzX2NhZmUiOiI5MjUiLCJjYXRfcmVxdWlyZXNfY2FmZSI6IiIsInByb2RfcmVxdWlyZXNfY2FmZSI6IjQ3NSw2OTYsNjk3LDEzMzQiLCJwcm9kX3VuY2hlY2tzX2NhZmUiOiI2ODUsNjkxLDY5Miw3MDMsNjk0LDExMjQsNjk1LDcwMCw5NTEsOTUzLDk1MiwxMTMyLDk1NSwxMjczLDk1NCw5NTAsMTI4Niw5NDEiLCJkeW5fY2F0X3RvX3BlcnRhaW5zX3RvX2NhZmUiOiI0NzUsNjk2LDY5NyIsInByb2RfY2hlY2tzX2NhZmUiOiI2OTgsMTAxNiw2OTksNzAxIiwiZHluX2NhdF90b19teXBhbmVyYV9waG9uZSI6IiJ9LCJjbGlja3N0cmVhbSI6eyJoYW5kbGVMb29rdXBGcm9tQWpheCI6ImN1c3RvbV9hY3Rpb24ifX0=','fUwBqp_Qms2EilH3dGScqlnwqZWuUuPxyyJruLWm~VGgHa91ct3U4G4Xqda5Z8tPMATSFzRAcq37I5sCw3T0jVkY0aV4TDXtF0v6uPat9xNmju0z6SbY7WleeVhxvRVusJBrUjRwaly~c!',1502382272,'HierarchyInput_81','custom/input/HierarchyInput','Custom.Widgets.input.HierarchyInput','81'); +W[c]({"i":{"c":"HierarchyInput","n":"HierarchyInput","w":82},"a":{"watch_field_name":"Z.CafeInfo.CafeCity.ID","label_nothing_selected":"Bakery-Cafe","lookup_query":"SELECT ID as Value, name as Label FROM CafeInfo.CafeInfo WHERE CafeCity = %d ORDER BY name ASC","ajax_value_lookup_endpoint":"\/ci\/ajax\/widget\/custom\/input\/HierarchyInput\/handleLookupFromAjax","label_input":"Bakery-Cafe","label_required":"%s is required","name":"X.Incident.CustomFields.CafeInfo.AssociatedCafe.ID","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":false,"hide_on_load":true,"read_only":false,"label_class_list":"rn_Hidden","cat_checks_cafe":"","cat_unchecks_cafe":"925","cat_requires_cafe":"","prod_requires_cafe":"475,696,697,1334","prod_unchecks_cafe":"685,691,692,703,694,1124,695,700,951,953,952,1132,955,1273,954,950,1286,941","dyn_cat_to_pertains_to_cafe":"475,696,697","prod_checks_cafe":"698,1016,699,701","dyn_cat_to_mypanera_phone":""},"j":{"type":"Menu","name":"X.Incident.CustomFields.CafeInfo.AssociatedCafe.ID","custom":false,"constraints":[]}},'eyJleHRlbmRzIjpbInN0YW5kYXJkXC9pbnB1dFwvU2VsZWN0aW9uSW5wdXQiXSwibm9uRGVmYXVsdEF0dHJWYWx1ZXMiOnsibGFiZWxfaW5wdXQiOiJCYWtlcnktQ2FmZSIsImxhYmVsX2NsYXNzX2xpc3QiOiJybl9IaWRkZW4iLCJsYWJlbF9ub3RoaW5nX3NlbGVjdGVkIjoiQmFrZXJ5LUNhZmUiLCJuYW1lIjoiWC5JbmNpZGVudC5DdXN0b21GaWVsZHMuQ2FmZUluZm8uQXNzb2NpYXRlZENhZmUuSUQiLCJoaWRlX29uX2xvYWQiOiJ0cnVlIiwicmVxdWlyZWQiOiJmYWxzZSIsIndhdGNoX2ZpZWxkX25hbWUiOiJaLkNhZmVJbmZvLkNhZmVDaXR5LklEIiwibG9va3VwX3F1ZXJ5IjoiU0VMRUNUIElEIGFzIFZhbHVlLCBuYW1lIGFzIExhYmVsIEZST00gQ2FmZUluZm8uQ2FmZUluZm8gV0hFUkUgQ2FmZUNpdHkgPSAlZCBPUkRFUiBCWSBuYW1lIEFTQyIsImNhdF9jaGVja3NfY2FmZSI6IiIsImNhdF91bmNoZWNrc19jYWZlIjoiOTI1IiwiY2F0X3JlcXVpcmVzX2NhZmUiOiIiLCJwcm9kX3JlcXVpcmVzX2NhZmUiOiI0NzUsNjk2LDY5NywxMzM0IiwicHJvZF91bmNoZWNrc19jYWZlIjoiNjg1LDY5MSw2OTIsNzAzLDY5NCwxMTI0LDY5NSw3MDAsOTUxLDk1Myw5NTIsMTEzMiw5NTUsMTI3Myw5NTQsOTUwLDEyODYsOTQxIiwiZHluX2NhdF90b19wZXJ0YWluc190b19jYWZlIjoiNDc1LDY5Niw2OTciLCJwcm9kX2NoZWNrc19jYWZlIjoiNjk4LDEwMTYsNjk5LDcwMSIsImR5bl9jYXRfdG9fbXlwYW5lcmFfcGhvbmUiOiIifSwiY2xpY2tzdHJlYW0iOnsiaGFuZGxlTG9va3VwRnJvbUFqYXgiOiJjdXN0b21fYWN0aW9uIn19','fUevlhxb5xBuKfrzvOQEMQaXFjSiM3_V_8ZZSa_Lb3wEpWC8jiY3ueXR32AER~MKJyFO2hGhdXZEUEugqy~e0vPMwtytQRpRstK3hGJqYJVSlA4K2Glg1_rvPteXp08QOU0yidVbrMf~Y!',1502382272,'HierarchyInput_82','custom/input/HierarchyInput','Custom.Widgets.input.HierarchyInput','82'); +W[c]({"i":{"c":"TextInput","n":"TextInput","w":83},"a":{"placeholder_text":"Your Feedback","label_input":"We\u2019d love to hear your feedback. Please share your comments, questions or suggestions here.","label_error":"","label_required":"%s is required","name":"Incident.Threads","required":true,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"always_show_mask":true,"default_value":"","allow_external_login_updates":false,"hide_hint":false,"existing_contact_check_ajax":"\/ci\/ajaxRequest\/checkForExistingContact","require_validation":false,"maximum_length":500,"minimum_length":0,"maximum_value":null,"minimum_value":null,"label_validation_incorrect":"Validation for the field '%s' failed","label_validation":"Re-enter a value for the field '%s'","textarea":false,"hide_on_load":false,"read_only":false},"j":{"type":"Thread","name":"Incident.Threads","custom":false,"constraints":{"maxLength":500,"maxBytes":1048576},"readOnly":false,"contactToken":"ZlVyWjJERnVPQnR3MzFWOERzRlVfbkFBQ054T3ZKbWl0TVdHUks1SUhXa00zS3Z6azd3Y3pYYkhna1FVcVY3cE9xeURvVHVEOVI0VENabU51RlhxaG1kQUFXOHNaeGFxUXU3WVplRE04S0NfSlpBa0FBdmtTQW9WRU9tVUJKUHV6ZFZSX3lfNGYzT1lnIQ!!"}},'W10=','fUlKPU4iWWb~9jn9X4WSB27VLW3GkwCBKNO~3hkojv4SnqXmxKzryXF4Df_hSxgpn7yx6Oz3GZ~VZs1IOFxKCHpqfsrKMXctvT6UX3DXvi8sDO3j4LdQy_d~wHqyq62vqDALpt0BpSspY!',1502382272,'TextInput_83','custom/input/TextInput','Custom.Widgets.input.TextInput','83'); +W[c]({"i":{"c":"SelectionInput","n":"SelectionInput","w":85},"a":{"label_input":"If you would like a response from our Customer Care Team, please make sure this box is checked.","label_required":"%s is required","name":"Incident.CustomFields.c.email_opt_in","required":false,"hint":"","always_show_hint":false,"initial_focus":false,"validate_on_blur":false,"default_value":"true","allow_external_login_updates":false,"hide_hint":false,"display_as_checkbox":true,"hide_on_load":false,"read_only":false,"sub_id":"selection"},"j":{"type":"Boolean","name":"Incident.CustomFields.c.email_opt_in","custom":true,"constraints":[],"mask":null,"readOnly":false}},'W10=','fUtXBp_yuuZ9TnQou9CPo4Hk1ItPpLIO8bciG6D3YRHXe3MLMKakIi~1P7HBPUkZOoGvyg2RTDQcrc8__ZOW3ODBxNz2YcMR3ieTsCEqjysVtza5rq9aaoQfgSMyYbCZCBI0OKep1yFZw!',1502382272,'SelectionInput_85','standard/input/SelectionInput','RightNow.Widgets.SelectionInput','85'); +W[c]({"i":{"c":"FormSubmit","n":"FormSubmit","w":86},"a":{"label_button":"Send","label_confirm_dialog":"","label_submitting_message":"Submitting...","on_success_url":"\/app\/ask_confirm","label_on_success_banner":"","error_location":"rn_ErrorLocation","add_params_to_url":"","challenge_location":"","challenge_required":false,"timeout":0},"j":{"f_tok":"ZlUzc2FFOUYyfk4xbThBcWlRMUJ6Y3VkREtaYU5BUldaYkoxNHFoYzhKeXhLNEpwb3NQcEhDMjdXeEdURnBNUTRhY1FCZlkwUXdqYmh4eUliTnVmbkxVeDlUU2xGTmNwSUdaMWd_RXdNbTRTdG1iMW9SSUE4dlQyNHpvczJfaVAyanRwZVZ6bmNCNUlFIQ!!","formExpiration":1500000}},'W10=','fUQJczPHPsF6HbB5HmWivuGernsYWwMU2s23J4z33LvC~yCwSi4qEQPp3fNYwB323rU0WgKSpm~bI0~oZ5ZJIUSlMNn_GcPeEYXudTOmgOJv6vxS0Y9zXgpvqtpTTnRk_ndauJU565Vvw!',1502382272,'FormSubmit_86','standard/input/FormSubmit','RightNow.Widgets.FormSubmit','86'); +W[c]({"i":{"c":"SmartAssistantDialog","n":"SmartAssistantDialog","w":87},"a":{"get_answer_content":"\/ci\/ajaxRequest\/getAnswer","get_discussion_content":"\/ci\/ajaxRequest\/getDiscussion","label_banner":"Your question hasn't been submitted yet.","label_prompt":"The following official answers and discussions might help you immediately.","label_no_results":"Sorry, no suggestions were found.","label_submit_button":"Finish Submitting Question","label_cancel_button":"Edit Question","label_solved_button":"My Question is Answered","label_dialog_title":"Finish submitting your question","label_collapsed":"Answer closed, click or double tap to open","label_expanded":"Answer opened, click or double tap to close","label_accesskey":"If you prefer the keyboard, you can use %s + 1-%d to access each answer","label_download_attachment":"Download Attachment","label_view_guide":"View answer with guide","solved_url":"\/app\/home","accesskeys_enabled":true,"display_inline":true,"button_ordering":[{"name":"label_solved_button","label":"My Question is Answered","displayAsLink":false},{"name":"label_submit_button","label":"Finish Submitting Question","displayAsLink":false},{"name":"label_cancel_button","label":"Edit Question","displayAsLink":true}],"display_button_as_link":"label_cancel_button","dnc_label_cancel_button":"","dnc_label_banner":"","dnc_label_dialog_title":"","dnc_redirect_url":""},"j":{"statuses":{"suspended":{"39":{"StatusLookupName":"Suspended"}}}}},'W10=','fUlj5XnwXiAszpaV6s2AvsPdzaAz7Ok1zjCS2efQTkCAHtlB9O5SjEEGWEeP8D~fMHp~Mi1i~SHnwUmqO9Z2oqWUZ8y0~kNHerJ7UZQhm1iQgx~vqZZakb~c1vKkyeZJkN2ilwj0hZHns!',1502382272,'SmartAssistantDialog_87','standard/input/SmartAssistantDialog','RightNow.Widgets.SmartAssistantDialog','87'); +})}); +/* ]]> */ +</script> +<script type="text/javascript"> +var _rnq=_rnq||[];_rnq.push({"s":"EF7E7Ppn","uh":"eb7576a4","uc":"panera.custhelp.com\/app\/ask","b":"ca93482","i":"panera:panera","f":"rnw","p":"Customer Portal","v":"15.11.0.1-b243-sp7","th":"www.rnengage.com"}); +(function(f){var b,d,a=document.createElement("iframe"),c=document.getElementsByTagName("script");a.src="javascript:false";a.title="";a.role="presentation";(a.frameElement||a).style.cssText="position:absolute;width:0;height:0;border:0";c=c[c.length-1];c.parentNode.insertBefore(a,c);try{b=a.contentWindow.document}catch(g){d=document.domain,a.src="javascript:var d=document.open();d.domain='"+d+"';void(0);",b=a.contentWindow.document}b.open()._l=function(){for(var a;f.length;)a=this.createElement("script"),d&&(this.domain= +d),a.src=f.pop(),this.body.appendChild(a)};b.write('<body onload="document._l();">');b.close()})(["https://www.rnengage.com/api/e/ca93482/e.js","//www.rnengage.com/api/1/javascript/acs.js"]); +</script><script src='/euf/core/3.3/thirdParty/js/Markdown.Converter.min.js'></script> +</body> +</html>
diff --git a/chrome/test/data/autofill/heuristics/output/147_panera.custhelp.com_app_ask.out b/chrome/test/data/autofill/heuristics/output/147_panera.custhelp.com_app_ask.out new file mode 100644 index 0000000..f9ed47c5 --- /dev/null +++ b/chrome/test/data/autofill/heuristics/output/147_panera.custhelp.com_app_ask.out
@@ -0,0 +1,63 @@ +UNKNOWN_TYPE | Incident.CustomFields.c.escalated_gift_card_devalue | Yes | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.escalated_gift_card_devalue | No | 0 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.escalated_catering_sales | Yes | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.escalated_catering_sales | No | 0 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_escalated_team_assign.month | Month | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_escalated_team_assign.day | Day | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_escalated_team_assign.year | Year | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_escalated_team_assign.hour | Hour | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_escalated_team_assign.minute | Minute | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_initial_tracking.month | Month | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_initial_tracking.day | Day | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_initial_tracking.year | Year | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_initial_tracking.hour | Hour | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_initial_tracking.minute | Minute | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_analyst_assignment.month | Month | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_analyst_assignment.day | Day | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_analyst_assignment.year | Year | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_analyst_assignment.hour | Hour | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_team_analyst_assignment.minute | Minute | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_external_reference_nbr | PA External Reference Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_tracking_monitor_control | Yes | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pa_tracking_monitor_control | No | 0 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_super_agent | Yes | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_super_agent | No | 0 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_request_type | Gift Card Request Type | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_action | Gift Card Action | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_issuer_person | Gift Card Issuer (person) | 588 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_appeasement_amt | Gift Card Appeasement $ Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_amount_new | Gift Card Amount (new) Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_new_card | Gift Card - New Card # Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_box_number | Gift Card Box # Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_frozen_amount | Gift Card Amount (frozen) Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_frozen_card_number | Gift Card Frozen Card # Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.gift_card_issuing_location | Gift Card Issuing Location Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.chat_type | Chat Topic Please select the Chat topic that best fits the issue | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.last_4_digits | last 4 digits Optional Optional Enter the last 4 digits of the customer's credit card | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pertains_to_cafe | Yes Does your question or comment pertain to a specific bakery-cafe? If it does, please select this option so we can be sure we are addressing the correct bakery-cafe. | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pertains_to_cafe | No | 0 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.send_to_franchise | Yes | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.send_to_franchise | No | 0 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.order_cancellation | Yes | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.order_cancellation | No | 0 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.admin_workspace_selection | Workspace selection | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.esc_reasonforrefund | Reason for Refund v2 Reason for providing the guest a refund. | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.esc_paymentmethod | Payment Method | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.email_opt_in | Yes | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.email_opt_in | No | 0 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.franchise_forward | Yes | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.franchise_forward | No | 0 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.passthrough_textarea | Pass Through Text Area Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.Subject | Subject Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-cc +NAME_FIRST | Contact.Name.First | First Name * Required | | Incident.CustomFields.c.escalated_gift_card_devalue_1-cc +NAME_LAST | Contact.Name.Last | Last Name * Required | | Incident.CustomFields.c.escalated_gift_card_devalue_1-cc +EMAIL_ADDRESS | Contact.Emails.PRIMARY.Address | Email Address * Required | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +PHONE_HOME_WHOLE_NUMBER | Contact.Phones.HOME.Number | Phone Number Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Contact.CustomFields.c.panera_my_panera_number | MyPanera Card Number Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.pertains_to_cafe | Does your question pertain to a specific bakery-cafe? | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +ADDRESS_HOME_STATE | Z.CafeInfo.CafeState.ID | Screen Reader users press enter to select a Please share a bit more detail. This will help us assist you more quickly.. Please share a bit more detail. This will help us assist you more quickly. * Required This button does not work with screen readers. Please use the previous link instead. Details | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +ADDRESS_HOME_CITY | Z.CafeInfo.CafeCity.ID | Screen Reader users press enter to select a Please share a bit more detail. This will help us assist you more quickly.. Please share a bit more detail. This will help us assist you more quickly. * Required This button does not work with screen readers. Please use the previous link instead. Details | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | X.Incident.CustomFields.CafeInfo.AssociatedCafe.ID | Bakery-Cafe | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.Threads | We’d love to hear your feedback. Please share your comments, questions or suggestions here. * Required | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | Incident.CustomFields.c.email_opt_in | If you would like a response from our Customer Care Team, please make sure this box is checked. | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default +UNKNOWN_TYPE | rn_FormSubmit_86_Submission | Send | on | Incident.CustomFields.c.escalated_gift_card_devalue_1-default
diff --git a/chrome/test/vr/perf/latency/motopho_thread.py b/chrome/test/vr/perf/latency/motopho_thread.py index a74534ca..d104370 100644 --- a/chrome/test/vr/perf/latency/motopho_thread.py +++ b/chrome/test/vr/perf/latency/motopho_thread.py
@@ -7,6 +7,10 @@ import threading +MIN_VALID_LATENCY = 10 +MAX_VALID_LATENCY = 1000 + + class MotophoThread(threading.Thread): """Handles the running of the Motopho script and extracting results.""" def __init__(self): @@ -49,6 +53,27 @@ if (len(self._latencies) > current_num_samples and len(self._correlations) > current_num_samples): break; + if not self._failed_iteration: + # Rarely, the reported latency will be lower than physically possible + # (Single digit latency when it should be impossible to get below the + # scan out latency of 16.7 ms) or impossibly high (tens of seconds when + # the test lasts < 10 seconds). Clearly, these results are invalid, so + # repeat as if we failed to get the latency at all. + # TODO(bsheedy): Figure out the root cause of this instead of working + # around it crbug.com/755596. + if self._latencies[-1] < MIN_VALID_LATENCY: + logging.error('Measured latency of %f lower than min of %d\n' + 'Logging raw output: %s', self._latencies[-1], + MIN_VALID_LATENCY, motopho_output) + self._failed_iteration = True + elif self._latencies[-1] > MAX_VALID_LATENCY: + logging.error('Measured latency of %f higher than max of %d\n' + 'Logging raw output: %s', self._latencies[-1], + MAX_VALID_LATENCY, motopho_output) + self._failed_iteration = True + if self._failed_iteration: + del self._latencies[-1] + del self._correlations[-1] self._EndIteration() def _WaitForIterationStart(self):
diff --git a/chrome/test/vr/perf/latency/webvr_latency_test.py b/chrome/test/vr/perf/latency/webvr_latency_test.py index 11c792d..518bdd9 100644 --- a/chrome/test/vr/perf/latency/webvr_latency_test.py +++ b/chrome/test/vr/perf/latency/webvr_latency_test.py
@@ -18,7 +18,7 @@ MOTOPHO_THREAD_TIMEOUT = 15 MOTOPHO_THREAD_TERMINATION_TIMEOUT = 2 -MOTOPHO_THREAD_RETRIES = 2 +MOTOPHO_THREAD_RETRIES = 4 DEFAULT_URLS = [ # TODO(bsheedy): See about having versioned copies of the flicker app # instead of using personal github.
diff --git a/components/arc/arc_session.cc b/components/arc/arc_session.cc index b98a1b0d2..f20d134 100644 --- a/components/arc/arc_session.cc +++ b/components/arc/arc_session.cc
@@ -362,7 +362,6 @@ base::ScopedFD socket_fd) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_EQ(state_, State::STARTING_INSTANCE); - DCHECK(socket_fd.is_valid()); // either a socket or a dummy fd. bool resumed = false; if (!container_instance_id_.empty()) { @@ -422,6 +421,9 @@ return; } + // For production, |socket_fd| passed from session_manager is either a valid + // socket or a valid file descriptor (/dev/null). For testing, |socket_fd| + // might be invalid. mojo::edk::PlatformHandle raw_handle(socket_fd.release()); raw_handle.needs_connection = true;
diff --git a/components/arc/arc_session_runner.cc b/components/arc/arc_session_runner.cc index 8927c0a..d77f000 100644 --- a/components/arc/arc_session_runner.cc +++ b/components/arc/arc_session_runner.cc
@@ -236,12 +236,10 @@ // safe place to start the container for login screen. DCHECK(!arc_session_); DCHECK_EQ(state_, State::STOPPED); - - // TODO(yusukes): Once Chrome OS side is ready, uncomment the following: - // arc_session_ = factory_.Run(); - // arc_session_->AddObserver(this); - // state_ = State::STARTING_FOR_LOGIN_SCREEN; - // arc_session_->StartForLoginScreen(); + arc_session_ = factory_.Run(); + arc_session_->AddObserver(this); + state_ = State::STARTING_FOR_LOGIN_SCREEN; + arc_session_->StartForLoginScreen(); } } // namespace arc
diff --git a/components/arc/arc_session_runner_unittest.cc b/components/arc/arc_session_runner_unittest.cc index 6860f35..ab2204c 100644 --- a/components/arc/arc_session_runner_unittest.cc +++ b/components/arc/arc_session_runner_unittest.cc
@@ -196,9 +196,7 @@ } // Does the same with the mini instance for login screen. -// TODO(yusukes): Enable the test once EmitLoginPromptVisibleCalled() is fully -// enabled. -TEST_F(ArcSessionRunnerTest, DISABLED_BootFailureForLoginScreen) { +TEST_F(ArcSessionRunnerTest, BootFailureForLoginScreen) { ResetArcSessionFactory( base::Bind(&ArcSessionRunnerTest::CreateBootFailureArcSession, ArcStopReason::CRASH)); @@ -221,9 +219,7 @@ // Tests that RequestStart() works even after EmitLoginPromptVisibleCalled() // is called. -// TODO(yusukes): Enable the test once EmitLoginPromptVisibleCalled() is fully -// enabled. -TEST_F(ArcSessionRunnerTest, DISABLED_StartWithLoginScreenInstance) { +TEST_F(ArcSessionRunnerTest, StartWithLoginScreenInstance) { EXPECT_TRUE(arc_session_runner()->IsStopped()); chromeos::DBusThreadManager::Get()
diff --git a/components/arc/audio/DEPS b/components/arc/audio/DEPS index dc121e7..5ff5c5b 100644 --- a/components/arc/audio/DEPS +++ b/components/arc/audio/DEPS
@@ -1,4 +1,4 @@ include_rules = [ - "+ash", + "+ash/system/audio/tray_audio.h", "+chromeos/audio", ]
diff --git a/components/arc/bluetooth/arc_bluetooth_bridge.cc b/components/arc/bluetooth/arc_bluetooth_bridge.cc index 682694b..92ef78c0 100644 --- a/components/arc/bluetooth/arc_bluetooth_bridge.cc +++ b/components/arc/bluetooth/arc_bluetooth_bridge.cc
@@ -296,14 +296,84 @@ return ArcBluetoothBridgeFactory::GetForBrowserContext(context); } +template <typename T> +class ArcBluetoothBridge::InstanceObserver + : public InstanceHolder<T>::Observer { + public: + InstanceObserver(ArcBluetoothBridge* owner, + ArcBridgeService* arc_bridge_service) + : owner_(owner), arc_bridge_service_(arc_bridge_service) { + GetHolder()->AddObserver(this); + } + + ~InstanceObserver() override { GetHolder()->RemoveObserver(this); } + + protected: + InstanceHolder<T>* GetHolder(); + + ArcBridgeService* arc_bridge_service() { return arc_bridge_service_; } + + private: + // InstanceHolder<T>::Observer: + void OnInstanceReady() override { owner_->MaybeSendInitialPowerChange(); } + + // Unowned pointer + ArcBluetoothBridge* const owner_; + ArcBridgeService* const arc_bridge_service_; + + DISALLOW_COPY_AND_ASSIGN(InstanceObserver); +}; + +template <> +InstanceHolder<mojom::AppInstance>* +ArcBluetoothBridge::InstanceObserver<mojom::AppInstance>::GetHolder() { + return arc_bridge_service()->app(); +} + +template <> +InstanceHolder<mojom::IntentHelperInstance>* +ArcBluetoothBridge::InstanceObserver<mojom::IntentHelperInstance>::GetHolder() { + return arc_bridge_service()->intent_helper(); +} + +class ArcBluetoothBridge::AppInstanceObserver + : public InstanceObserver<mojom::AppInstance> { + public: + AppInstanceObserver(ArcBluetoothBridge* owner, + ArcBridgeService* arc_bridge_service) + : InstanceObserver<mojom::AppInstance>(owner, arc_bridge_service) {} + + ~AppInstanceObserver() override = default; + + private: + DISALLOW_COPY_AND_ASSIGN(AppInstanceObserver); +}; + +class ArcBluetoothBridge::IntentHelperInstanceObserver + : public InstanceObserver<mojom::IntentHelperInstance> { + public: + IntentHelperInstanceObserver(ArcBluetoothBridge* owner, + ArcBridgeService* arc_bridge_service) + : InstanceObserver<mojom::IntentHelperInstance>(owner, + arc_bridge_service) {} + + ~IntentHelperInstanceObserver() override = default; + + private: + DISALLOW_COPY_AND_ASSIGN(IntentHelperInstanceObserver); +}; + ArcBluetoothBridge::ArcBluetoothBridge(content::BrowserContext* context, ArcBridgeService* bridge_service) : arc_bridge_service_(bridge_service), binding_(this), - intent_helper_observer_(this), weak_factory_(this) { arc_bridge_service_->bluetooth()->AddObserver(this); - arc_bridge_service_->intent_helper()->AddObserver(&intent_helper_observer_); + + app_observer_ = + base::MakeUnique<AppInstanceObserver>(this, arc_bridge_service_); + intent_helper_observer_ = + base::MakeUnique<IntentHelperInstanceObserver>(this, arc_bridge_service_); if (BluetoothAdapterFactory::IsBluetoothSupported()) { VLOG(1) << "Registering bluetooth adapter."; @@ -320,8 +390,6 @@ if (bluetooth_adapter_) bluetooth_adapter_->RemoveObserver(this); - arc_bridge_service_->intent_helper()->RemoveObserver( - &intent_helper_observer_); arc_bridge_service_->bluetooth()->RemoveObserver(this); } @@ -1965,16 +2033,6 @@ std::move(addr), bond_state); } -ArcBluetoothBridge::IntentHelperObserver::IntentHelperObserver( - ArcBluetoothBridge* bluetooth_bridge) - : bluetooth_bridge_(bluetooth_bridge) {} - -ArcBluetoothBridge::IntentHelperObserver::~IntentHelperObserver() = default; - -void ArcBluetoothBridge::IntentHelperObserver::OnInstanceReady() { - bluetooth_bridge_->SendInitialPowerChange(); -} - bool ArcBluetoothBridge::IsPowerChangeInitiatedByRemote( ArcBluetoothBridge::AdapterPowerState powered) const { return !remote_power_changes_.empty() && @@ -1987,13 +2045,25 @@ local_power_changes_.front() == powered; } -void ArcBluetoothBridge::SendInitialPowerChange() { +void ArcBluetoothBridge::MaybeSendInitialPowerChange() { if (!bluetooth_adapter_ || !bluetooth_adapter_->IsPowered()) { // The default power state of Bluetooth on Android is off, so there is no // need to send an intent to turn off Bluetooth if the initial power state // is off. return; } + + // Send initial power state in case both, Intent Helper and App instances are + // present. Intent Helper is required to dispatch this event and App is sign + // that ARC is fully started. In case of initial boot, App instance is started + // after the Intent Helper instance. In case of next boot Intent Helper and + // App instances are started at almost the same time and order of start is not + // determined. + if (!arc_bridge_service_->app()->has_instance() || + !arc_bridge_service_->intent_helper()->has_instance()) { + return; + } + EnqueueLocalPowerChange(AdapterPowerState::TURN_ON); }
diff --git a/components/arc/bluetooth/arc_bluetooth_bridge.h b/components/arc/bluetooth/arc_bluetooth_bridge.h index f4d6e2b..d60af96 100644 --- a/components/arc/bluetooth/arc_bluetooth_bridge.h +++ b/components/arc/bluetooth/arc_bluetooth_bridge.h
@@ -346,25 +346,10 @@ std::unique_ptr<device::BluetoothGattNotifySession> notify_session); private: - // IntentHelperObserver listens to the OnInstanceReady call on the intent - // helper which indicated the IntentHelperService has been brought up and the - // initial powered state of Bluetooth adapter can be sent to Android. - class IntentHelperObserver - : public InstanceHolder<mojom::IntentHelperInstance>::Observer { - public: - explicit IntentHelperObserver(ArcBluetoothBridge* bluetooth_bridge); - ~IntentHelperObserver() override; - - private: - // InstanceHolder<mojom::IntentHelperInstance>::Observer overrides - void OnInstanceReady() override; - - // ArcBluetoothBridge owns IntentHelperObserver, and ArcBluetoothBridge will - // always outlive it. - ArcBluetoothBridge* const bluetooth_bridge_; - - DISALLOW_COPY_AND_ASSIGN(IntentHelperObserver); - }; + template <typename T> + class InstanceObserver; + class AppInstanceObserver; + class IntentHelperInstanceObserver; // Power state change on Bluetooth adapter. enum class AdapterPowerState { TURN_OFF, TURN_ON }; @@ -377,8 +362,8 @@ bool IsPowerChangeInitiatedByLocal( ArcBluetoothBridge::AdapterPowerState powered) const; - // Called by IntentHelperObserver to send the initial power state. - void SendInitialPowerChange(); + // Sends initial power state when all preconditions are met. + void MaybeSendInitialPowerChange(); // Manages the powered change intents sent to Android. void EnqueueLocalPowerChange(AdapterPowerState powered); @@ -526,8 +511,9 @@ // receive events. bool is_bluetooth_instance_up_; - // Observer to listen the start-up of Intent Helper. - IntentHelperObserver intent_helper_observer_; + // Observers to listen the start-up of App and Intent Helper. + std::unique_ptr<AppInstanceObserver> app_observer_; + std::unique_ptr<IntentHelperInstanceObserver> intent_helper_observer_; // Queue to track the powered state changes initiated by Android. std::queue<AdapterPowerState> remote_power_changes_; // Queue to track the powered state changes initiated by Chrome.
diff --git a/components/arc/intent_helper/DEPS b/components/arc/intent_helper/DEPS index 4dbd757f..e2ab3722 100644 --- a/components/arc/intent_helper/DEPS +++ b/components/arc/intent_helper/DEPS
@@ -1,5 +1,10 @@ include_rules = [ - "+ash", + "+ash/link_handler_model.h", + "+ash/link_handler_model_factory.h", + "+ash/new_window_controller.h", + "+ash/shell.h", + "+ash/shell_delegate.h", + "+ash/wallpaper/wallpaper_controller.h", "+components/google/core/browser", "+ui/base", "+ui/gfx",
diff --git a/components/arc/power/DEPS b/components/arc/power/DEPS index aeeb731..ac7ae6d 100644 --- a/components/arc/power/DEPS +++ b/components/arc/power/DEPS
@@ -1,4 +1,4 @@ include_rules = [ - "+ash", + "+ash/shell.h", "+ui/display/manager/chromeos", ]
diff --git a/components/autofill/core/browser/autofill_experiments.cc b/components/autofill/core/browser/autofill_experiments.cc index fdf7e93..c87a8b8 100644 --- a/components/autofill/core/browser/autofill_experiments.cc +++ b/components/autofill/core/browser/autofill_experiments.cc
@@ -38,6 +38,9 @@ const base::Feature kAutofillOfferLocalSaveIfServerCardManuallyEntered{ "AutofillOfferLocalSaveIfServerCardManuallyEntered", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kAutofillRationalizeFieldTypePredictions{ + "AutofillRationalizeFieldTypePredictions", + base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kAutofillSuppressDisusedAddresses{ "AutofillSuppressDisusedAddresses", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kAutofillUpstreamRequestCvcIfMissing{
diff --git a/components/autofill/core/browser/autofill_experiments.h b/components/autofill/core/browser/autofill_experiments.h index 0a2f5c36..41d1f47 100644 --- a/components/autofill/core/browser/autofill_experiments.h +++ b/components/autofill/core/browser/autofill_experiments.h
@@ -32,6 +32,7 @@ extern const base::Feature kAutofillCreditCardPopupLayout; extern const base::Feature kAutofillCreditCardLastUsedDateDisplay; extern const base::Feature kAutofillOfferLocalSaveIfServerCardManuallyEntered; +extern const base::Feature kAutofillRationalizeFieldTypePredictions; extern const base::Feature kAutofillSuppressDisusedAddresses; extern const base::Feature kAutofillUpstreamRequestCvcIfMissing; extern const base::Feature kAutofillUpstreamShowNewUi;
diff --git a/components/autofill/core/browser/autofill_field.cc b/components/autofill/core/browser/autofill_field.cc index 8b62625..af0cddb0 100644 --- a/components/autofill/core/browser/autofill_field.cc +++ b/components/autofill/core/browser/autofill_field.cc
@@ -598,6 +598,17 @@ phone_part_ = IGNORED; } +void AutofillField::SetTypeTo(ServerFieldType type) { + if (type == UNKNOWN_TYPE || type == NO_SERVER_DATA) { + heuristic_type_ = UNKNOWN_TYPE; + server_type_ = NO_SERVER_DATA; + } else if (server_type_ == NO_SERVER_DATA) { + heuristic_type_ = type; + } else { + server_type_ = type; + } +} + AutofillType AutofillField::Type() const { // Use the html type specified by the website unless it is unrecognized and // autofill predicts a credit card type.
diff --git a/components/autofill/core/browser/autofill_field.h b/components/autofill/core/browser/autofill_field.h index 3fe8def..edfb606 100644 --- a/components/autofill/core/browser/autofill_field.h +++ b/components/autofill/core/browser/autofill_field.h
@@ -59,6 +59,10 @@ parseable_name_ = parseable_name; } + // Set the heuristic or server type, depending on whichever is currently + // assigned, to |type|. + void SetTypeTo(ServerFieldType type); + // This function automatically chooses between server and heuristic autofill // type, depending on the data available. AutofillType Type() const;
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc index edf404f..3757e15 100644 --- a/components/autofill/core/browser/autofill_manager_unittest.cc +++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -533,6 +533,9 @@ RendererFormDataAction action, const FormData& data)); + MOCK_METHOD1(SendAutofillTypePredictionsToRenderer, + void(const std::vector<FormStructure*>& forms)); + void SetIsIncognito(bool is_incognito) { is_incognito_ = is_incognito; } bool IsIncognito() const override { return is_incognito_; } @@ -857,7 +860,7 @@ autofill_client_.SetPrefs(test::PrefServiceForTesting()); personal_data_.set_database(autofill_client_.GetDatabase()); personal_data_.SetPrefService(autofill_client_.GetPrefs()); - autofill_driver_.reset(new MockAutofillDriver()); + autofill_driver_.reset(new testing::NiceMock<MockAutofillDriver>()); request_context_ = new net::TestURLRequestContextGetter( base::ThreadTaskRunnerHandle::Get()); autofill_driver_->SetURLRequestContext(request_context_.get()); @@ -1270,6 +1273,31 @@ download_manager_->VerifyLastQueriedForms(forms); } +// Test that when forms are seen, the renderer is updated with the predicted +// field types +TEST_F(AutofillManagerTest, OnFormsSeen_SendAutofillTypePredictionsToRenderer) { + // Set up a queryable form. + FormData form1; + test::CreateTestAddressFormData(&form1); + + // Set up a non-queryable form. + FormData form2; + FormFieldData field; + test::CreateTestFormField("Querty", "qwerty", "", "text", &field); + form2.name = ASCIIToUTF16("NonQueryable"); + form2.origin = form1.origin; + form2.action = GURL("https://myform.com/submit.html"); + form2.fields.push_back(field); + + // Package the forms for observation. + std::vector<FormData> forms{form1, form2}; + + // Setup expectations. + EXPECT_CALL(*autofill_driver_, SendAutofillTypePredictionsToRenderer(_)) + .Times(2); + FormsSeen(forms); +} + // Test that no autofill suggestions are returned for a field with an // unrecognized autocomplete attribute. TEST_F(AutofillManagerTest, GetProfileSuggestions_UnrecognizedAttribute) {
diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc index 3adb3c7c..531a2075 100644 --- a/components/autofill/core/browser/form_structure.cc +++ b/components/autofill/core/browser/form_structure.cc
@@ -23,6 +23,7 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" +#include "components/autofill/core/browser/autofill_experiments.h" #include "components/autofill/core/browser/autofill_metrics.h" #include "components/autofill/core/browser/autofill_type.h" #include "components/autofill/core/browser/field_candidates.h" @@ -393,6 +394,9 @@ AutofillMetrics::LogDeveloperEngagementUkm(ukm_recorder, source_url(), developer_engagement_metrics); + if (base::FeatureList::IsEnabled(kAutofillRationalizeFieldTypePredictions)) + RationalizeFieldTypePredictions(); + AutofillMetrics::LogDetermineHeuristicTypesTiming( base::TimeTicks::Now() - determine_heuristic_types_start_time); } @@ -519,6 +523,9 @@ form->UpdateAutofillCount(); form->IdentifySections(false); + + if (base::FeatureList::IsEnabled(kAutofillRationalizeFieldTypePredictions)) + form->RationalizeFieldTypePredictions(); } AutofillMetrics::ServerQueryMetric metric; @@ -1044,6 +1051,148 @@ return !operator==(form); } +void FormStructure::RationalizeFieldTypePredictions() { + bool cc_first_name_found = false; + bool cc_last_name_found = false; + bool cc_num_found = false; + bool cc_month_found = false; + bool cc_year_found = false; + bool cc_type_found = false; + bool cc_cvc_found = false; + size_t num_months_found = 0; + size_t num_other_fields_found = 0; + for (const auto& field : fields_) { + ServerFieldType current_field_type = field->Type().GetStorableType(); + switch (current_field_type) { + case CREDIT_CARD_NAME_FIRST: + cc_first_name_found = true; + break; + case CREDIT_CARD_NAME_LAST: + cc_last_name_found = true; + break; + case CREDIT_CARD_NAME_FULL: + cc_first_name_found = true; + cc_last_name_found = true; + break; + case CREDIT_CARD_NUMBER: + cc_num_found = true; + break; + case CREDIT_CARD_EXP_MONTH: + cc_month_found = true; + ++num_months_found; + break; + case CREDIT_CARD_EXP_2_DIGIT_YEAR: + case CREDIT_CARD_EXP_4_DIGIT_YEAR: + cc_year_found = true; + break; + case CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR: + case CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR: + cc_month_found = true; + cc_year_found = true; + ++num_months_found; + break; + case CREDIT_CARD_TYPE: + cc_type_found = true; + break; + case CREDIT_CARD_VERIFICATION_CODE: + cc_cvc_found = true; + break; + case ADDRESS_HOME_ZIP: + case ADDRESS_BILLING_ZIP: + // Zip/Postal code often appears as part of a Credit Card form. Do + // not count it as a non-cc-related field. + break; + default: + ++num_other_fields_found; + } + } + + // A partial CC name is unlikely. Prefer to consider these profile names + // when partial. + bool cc_name_found = cc_first_name_found && cc_last_name_found; + + // A partial CC expiry date should not be filled. These are often confused + // with quantity/height fields and/or generic year fields. + bool cc_date_found = cc_month_found && cc_year_found; + + // Count the credit card related fields in the form. + size_t num_cc_fields_found = + static_cast<int>(cc_name_found) + static_cast<int>(cc_num_found) + + static_cast<int>(cc_date_found) + static_cast<int>(cc_type_found) + + static_cast<int>(cc_cvc_found); + + // Retain credit card related fields if the form has multiple fields or has + // no unrelated fields (useful for single cc-field forms). Credit card number + // is permitted to be alone in an otherwise unrelated form because some + // dynamic forms reveal the remainder of the fields only after the credit + // card number is entered and identified as a credit card by the site. + bool keep_cc_fields = + cc_num_found || num_cc_fields_found >= 3 || num_other_fields_found == 0; + + // Do an update pass over the fields to rewrite the types if credit card + // fields are not to be retained. Some special handling is given to expiry + // dates if the full date is not found or multiple expiry date fields are + // found. See comments inline below. + for (auto it = fields_.begin(); it != fields_.end(); ++it) { + auto& field = *it; + ServerFieldType current_field_type = field->Type().GetStorableType(); + switch (current_field_type) { + case CREDIT_CARD_NAME_FIRST: + if (!keep_cc_fields) + field->SetTypeTo(NAME_FIRST); + break; + case CREDIT_CARD_NAME_LAST: + if (!keep_cc_fields) + field->SetTypeTo(NAME_LAST); + break; + case CREDIT_CARD_NAME_FULL: + if (!keep_cc_fields) + field->SetTypeTo(NAME_FULL); + break; + case CREDIT_CARD_NUMBER: + case CREDIT_CARD_TYPE: + case CREDIT_CARD_VERIFICATION_CODE: + case CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR: + case CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR: + if (!keep_cc_fields) + field->SetTypeTo(UNKNOWN_TYPE); + break; + case CREDIT_CARD_EXP_MONTH: + // Do not preserve an expiry month prediction if any of the following + // are true: + // (1) the form is determined to be be non-cc related, so all cc + // field predictions are to be discarded + // (2) the expiry month was found without a corresponding year + // (3) multiple month fields were found in a form having a full + // expiry date. This usually means the form is a checkout form + // that also has one or more quantity fields. Suppress the expiry + // month field(s) not immediately preceding an expiry year field. + if (!keep_cc_fields || !cc_date_found) { + field->SetTypeTo(UNKNOWN_TYPE); + } else if (num_months_found > 1) { + auto it2 = it + 1; + if (it2 == fields_.end()) { + field->SetTypeTo(UNKNOWN_TYPE); + } else { + ServerFieldType next_field_type = (*it2)->Type().GetStorableType(); + if (next_field_type != CREDIT_CARD_EXP_2_DIGIT_YEAR && + next_field_type != CREDIT_CARD_EXP_4_DIGIT_YEAR) { + field->SetTypeTo(UNKNOWN_TYPE); + } + } + } + break; + case CREDIT_CARD_EXP_2_DIGIT_YEAR: + case CREDIT_CARD_EXP_4_DIGIT_YEAR: + if (!keep_cc_fields || !cc_date_found) + field->SetTypeTo(UNKNOWN_TYPE); + break; + default: + break; + } + } +} + void FormStructure::EncodeFormForQuery( AutofillQueryContents::Form* query_form) const { DCHECK(!IsMalformed());
diff --git a/components/autofill/core/browser/form_structure.h b/components/autofill/core/browser/form_structure.h index ec8d8d44..a1094eb 100644 --- a/components/autofill/core/browser/form_structure.h +++ b/components/autofill/core/browser/form_structure.h
@@ -252,6 +252,11 @@ FRIEND_TEST_ALL_PREFIXES(AutofillDownloadTest, QueryAndUploadTest); FRIEND_TEST_ALL_PREFIXES(FormStructureTest, FindLongestCommonPrefix); + // A helper function to avoid suggesting field types in cases where they are + // highly unlikely. For example: lone credit card fields in an otherwise + // non-credit-card related form. + void RationalizeFieldTypePredictions(); + // Encodes information about this form and its fields into |query_form|. void EncodeFormForQuery( autofill::AutofillQueryContents::Form* query_form) const;
diff --git a/components/autofill/core/browser/form_structure_unittest.cc b/components/autofill/core/browser/form_structure_unittest.cc index 11ba39b..ff6cd26 100644 --- a/components/autofill/core/browser/form_structure_unittest.cc +++ b/components/autofill/core/browser/form_structure_unittest.cc
@@ -9,11 +9,14 @@ #include <memory> #include "base/command_line.h" +#include "base/feature_list.h" #include "base/memory/ptr_util.h" #include "base/metrics/field_trial.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" +#include "components/autofill/core/browser/autofill_experiments.h" #include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill/core/common/autofill_switches.h" #include "components/autofill/core/common/form_data.h" @@ -3822,6 +3825,270 @@ EXPECT_EQ(UNKNOWN_TYPE, forms[0]->field(1)->Type().GetStorableType()); } +TEST_F(FormStructureTest, ParseQueryResponse_RationalizeLoneField) { + FormData form; + form.origin = GURL("http://foo.com"); + FormFieldData field; + field.form_control_type = "text"; + + field.label = ASCIIToUTF16("fullname"); + field.name = ASCIIToUTF16("fullname"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("address"); + field.name = ASCIIToUTF16("address"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("height"); + field.name = ASCIIToUTF16("height"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("email"); + field.name = ASCIIToUTF16("email"); + form.fields.push_back(field); + + FormStructure form_structure(form); + std::vector<FormStructure*> forms; + forms.push_back(&form_structure); + + AutofillQueryResponseContents response; + response.add_field()->set_autofill_type(NAME_FULL); + response.add_field()->set_autofill_type(ADDRESS_HOME_LINE1); + response.add_field()->set_autofill_type(CREDIT_CARD_EXP_MONTH); // Uh-oh! + response.add_field()->set_autofill_type(EMAIL_ADDRESS); + + std::string response_string; + ASSERT_TRUE(response.SerializeToString(&response_string)); + + // Test that the expiry month field is rationalized away when enabled. + { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + autofill::kAutofillRationalizeFieldTypePredictions); + + FormStructure::ParseQueryResponse(response_string, forms); + ASSERT_EQ(1U, forms.size()); + ASSERT_EQ(4U, forms[0]->field_count()); + EXPECT_EQ(NAME_FULL, forms[0]->field(0)->server_type()); + EXPECT_EQ(ADDRESS_HOME_LINE1, forms[0]->field(1)->server_type()); + EXPECT_EQ(NO_SERVER_DATA, forms[0]->field(2)->server_type()); + EXPECT_EQ(EMAIL_ADDRESS, forms[0]->field(3)->server_type()); + } + + // Sanity check that the enable/disabled works. + { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature( + autofill::kAutofillRationalizeFieldTypePredictions); + + FormStructure::ParseQueryResponse(response_string, forms); + ASSERT_EQ(1U, forms.size()); + ASSERT_EQ(4U, forms[0]->field_count()); + EXPECT_EQ(NAME_FULL, forms[0]->field(0)->server_type()); + EXPECT_EQ(ADDRESS_HOME_LINE1, forms[0]->field(1)->server_type()); + EXPECT_EQ(CREDIT_CARD_EXP_MONTH, forms[0]->field(2)->server_type()); + EXPECT_EQ(EMAIL_ADDRESS, forms[0]->field(3)->server_type()); + } +} + +TEST_F(FormStructureTest, ParseQueryResponse_RationalizeCCName) { + FormData form; + form.origin = GURL("http://foo.com"); + FormFieldData field; + field.form_control_type = "text"; + + field.label = ASCIIToUTF16("First Name"); + field.name = ASCIIToUTF16("fname"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("Last Name"); + field.name = ASCIIToUTF16("lname"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("email"); + field.name = ASCIIToUTF16("email"); + form.fields.push_back(field); + + FormStructure form_structure(form); + std::vector<FormStructure*> forms; + forms.push_back(&form_structure); + + AutofillQueryResponseContents response; + response.add_field()->set_autofill_type(CREDIT_CARD_NAME_FIRST); + response.add_field()->set_autofill_type(CREDIT_CARD_NAME_LAST); + response.add_field()->set_autofill_type(EMAIL_ADDRESS); + + std::string response_string; + ASSERT_TRUE(response.SerializeToString(&response_string)); + + // Test that the name fields are rationalized when enabled. + { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + autofill::kAutofillRationalizeFieldTypePredictions); + + FormStructure::ParseQueryResponse(response_string, forms); + ASSERT_EQ(1U, forms.size()); + ASSERT_EQ(3U, forms[0]->field_count()); + EXPECT_EQ(NAME_FIRST, forms[0]->field(0)->server_type()); + EXPECT_EQ(NAME_LAST, forms[0]->field(1)->server_type()); + EXPECT_EQ(EMAIL_ADDRESS, forms[0]->field(2)->server_type()); + } + + // Sanity check that the enable/disabled works. + { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature( + autofill::kAutofillRationalizeFieldTypePredictions); + + FormStructure::ParseQueryResponse(response_string, forms); + ASSERT_EQ(1U, forms.size()); + ASSERT_EQ(3U, forms[0]->field_count()); + EXPECT_EQ(CREDIT_CARD_NAME_FIRST, forms[0]->field(0)->server_type()); + EXPECT_EQ(CREDIT_CARD_NAME_LAST, forms[0]->field(1)->server_type()); + EXPECT_EQ(EMAIL_ADDRESS, forms[0]->field(2)->server_type()); + } +} + +TEST_F(FormStructureTest, ParseQueryResponse_RationalizeMultiMonth_1) { + FormData form; + form.origin = GURL("http://foo.com"); + FormFieldData field; + field.form_control_type = "text"; + + field.label = ASCIIToUTF16("Cardholder"); + field.name = ASCIIToUTF16("fullname"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("Card Number"); + field.name = ASCIIToUTF16("address"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("Month)"); + field.name = ASCIIToUTF16("expiry_month"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("Year"); + field.name = ASCIIToUTF16("expiry_year"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("Quantity"); + field.name = ASCIIToUTF16("quantity"); + form.fields.push_back(field); + + FormStructure form_structure(form); + std::vector<FormStructure*> forms; + forms.push_back(&form_structure); + + AutofillQueryResponseContents response; + response.add_field()->set_autofill_type(CREDIT_CARD_NAME_FULL); + response.add_field()->set_autofill_type(CREDIT_CARD_NUMBER); + response.add_field()->set_autofill_type(CREDIT_CARD_EXP_MONTH); + response.add_field()->set_autofill_type(CREDIT_CARD_EXP_2_DIGIT_YEAR); + response.add_field()->set_autofill_type(CREDIT_CARD_EXP_MONTH); // Uh-oh! + + std::string response_string; + ASSERT_TRUE(response.SerializeToString(&response_string)); + + // Test that the extra month field is rationalized away when enabled. + { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + autofill::kAutofillRationalizeFieldTypePredictions); + + FormStructure::ParseQueryResponse(response_string, forms); + ASSERT_EQ(1U, forms.size()); + ASSERT_EQ(5U, forms[0]->field_count()); + EXPECT_EQ(CREDIT_CARD_NAME_FULL, forms[0]->field(0)->server_type()); + EXPECT_EQ(CREDIT_CARD_NUMBER, forms[0]->field(1)->server_type()); + EXPECT_EQ(CREDIT_CARD_EXP_MONTH, forms[0]->field(2)->server_type()); + EXPECT_EQ(CREDIT_CARD_EXP_2_DIGIT_YEAR, forms[0]->field(3)->server_type()); + EXPECT_EQ(NO_SERVER_DATA, forms[0]->field(4)->server_type()); + } + + // Sanity check that the enable/disabled works. + { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature( + autofill::kAutofillRationalizeFieldTypePredictions); + + FormStructure::ParseQueryResponse(response_string, forms); + ASSERT_EQ(1U, forms.size()); + ASSERT_EQ(5U, forms[0]->field_count()); + EXPECT_EQ(CREDIT_CARD_NAME_FULL, forms[0]->field(0)->server_type()); + EXPECT_EQ(CREDIT_CARD_NUMBER, forms[0]->field(1)->server_type()); + EXPECT_EQ(CREDIT_CARD_EXP_MONTH, forms[0]->field(2)->server_type()); + EXPECT_EQ(CREDIT_CARD_EXP_2_DIGIT_YEAR, forms[0]->field(3)->server_type()); + EXPECT_EQ(CREDIT_CARD_EXP_MONTH, forms[0]->field(4)->server_type()); + } +} + +TEST_F(FormStructureTest, ParseQueryResponse_RationalizeMultiMonth_2) { + FormData form; + form.origin = GURL("http://foo.com"); + FormFieldData field; + field.form_control_type = "text"; + + field.label = ASCIIToUTF16("Cardholder"); + field.name = ASCIIToUTF16("fullname"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("Card Number"); + field.name = ASCIIToUTF16("address"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("Expiry Date (MMYY)"); + field.name = ASCIIToUTF16("expiry"); + form.fields.push_back(field); + + field.label = ASCIIToUTF16("Quantity"); + field.name = ASCIIToUTF16("quantity"); + form.fields.push_back(field); + + FormStructure form_structure(form); + std::vector<FormStructure*> forms; + forms.push_back(&form_structure); + + AutofillQueryResponseContents response; + response.add_field()->set_autofill_type(CREDIT_CARD_NAME_FULL); + response.add_field()->set_autofill_type(CREDIT_CARD_NUMBER); + response.add_field()->set_autofill_type(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR); + response.add_field()->set_autofill_type(CREDIT_CARD_EXP_MONTH); // Uh-oh! + + std::string response_string; + ASSERT_TRUE(response.SerializeToString(&response_string)); + + // Test that the extra month field is rationalized away when enabled. + { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + autofill::kAutofillRationalizeFieldTypePredictions); + FormStructure::ParseQueryResponse(response_string, forms); + ASSERT_EQ(1U, forms.size()); + ASSERT_EQ(4U, forms[0]->field_count()); + EXPECT_EQ(CREDIT_CARD_NAME_FULL, forms[0]->field(0)->server_type()); + EXPECT_EQ(CREDIT_CARD_NUMBER, forms[0]->field(1)->server_type()); + EXPECT_EQ(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR, + forms[0]->field(2)->server_type()); + EXPECT_EQ(NO_SERVER_DATA, forms[0]->field(3)->server_type()); + } + + // Sanity check that the enable/disabled works. + { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature( + autofill::kAutofillRationalizeFieldTypePredictions); + FormStructure::ParseQueryResponse(response_string, forms); + ASSERT_EQ(1U, forms.size()); + ASSERT_EQ(4U, forms[0]->field_count()); + EXPECT_EQ(CREDIT_CARD_NAME_FULL, forms[0]->field(0)->server_type()); + EXPECT_EQ(CREDIT_CARD_NUMBER, forms[0]->field(1)->server_type()); + EXPECT_EQ(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR, + forms[0]->field(2)->server_type()); + EXPECT_EQ(CREDIT_CARD_EXP_MONTH, forms[0]->field(3)->server_type()); + } +} + TEST_F(FormStructureTest, FindLongestCommonPrefix) { // Normal case: All strings are longer than threshold; some are common. std::vector<base::string16> strings;
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc index 48ef263..e8313b5 100644 --- a/components/exo/shell_surface.cc +++ b/components/exo/shell_surface.cc
@@ -743,16 +743,6 @@ void ShellSurface::OnSurfaceCommit() { SurfaceTreeHost::OnSurfaceCommit(); - if (enabled() && !widget_) { - // Defer widget creation until surface contains some contents. - if (host_window()->bounds().size().IsEmpty()) { - Configure(); - return; - } - - CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL); - } - // Apply the accumulated pending origin offset to reflect acknowledged // configure requests. origin_offset_ += pending_origin_offset_; @@ -822,6 +812,19 @@ } } +void ShellSurface::OnSurfaceContentSizeChanged() { + SurfaceTreeHost::OnSurfaceContentSizeChanged(); + if (enabled() && !widget_) { + // Defer widget creation until surface contains some contents. + if (root_surface()->content_size().IsEmpty()) { + Configure(); + return; + } + + CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL); + } +} + //////////////////////////////////////////////////////////////////////////////// // SurfaceObserver overrides:
diff --git a/components/exo/shell_surface.h b/components/exo/shell_surface.h index e3739d4d..23a35ae 100644 --- a/components/exo/shell_surface.h +++ b/components/exo/shell_surface.h
@@ -231,6 +231,7 @@ // Overridden from SurfaceDelegate: void OnSurfaceCommit() override; + void OnSurfaceContentSizeChanged() override; // Overridden from SurfaceObserver: void OnSurfaceDestroying(Surface* surface) override;
diff --git a/components/exo/sub_surface.cc b/components/exo/sub_surface.cc index f170dae..5c1f6ab 100644 --- a/components/exo/sub_surface.cc +++ b/components/exo/sub_surface.cc
@@ -100,6 +100,8 @@ NOTIMPLEMENTED() << "Async subsurface is not supported!"; } +void SubSurface::OnSurfaceContentSizeChanged() {} + bool SubSurface::IsSurfaceSynchronized() const { // A sub-surface is effectively synchronized if either its parent is // synchronized or itself is in synchronized mode.
diff --git a/components/exo/sub_surface.h b/components/exo/sub_surface.h index d9480ac..90d57a6a 100644 --- a/components/exo/sub_surface.h +++ b/components/exo/sub_surface.h
@@ -50,6 +50,7 @@ // Overridden from SurfaceDelegate: void OnSurfaceCommit() override; + void OnSurfaceContentSizeChanged() override; bool IsSurfaceSynchronized() const override; // Overridden from SurfaceObserver:
diff --git a/components/exo/surface.cc b/components/exo/surface.cc index 59feeed8..298905cb 100644 --- a/components/exo/surface.cc +++ b/components/exo/surface.cc
@@ -114,9 +114,7 @@ bool CanFocus() override { return true; } void OnCaptureLost() override {} void OnPaint(const ui::PaintContext& context) override {} - void OnDeviceScaleFactorChanged(float device_scale_factor) override { - surface_->SetDeviceScaleFactor(device_scale_factor); - } + void OnDeviceScaleFactorChanged(float device_scale_factor) override {} void OnWindowDestroying(aura::Window* window) override {} void OnWindowDestroyed(aura::Window* window) override { delete this; } void OnWindowTargetVisibilityChanged(bool visible) override {} @@ -396,10 +394,6 @@ pending_state_.alpha = alpha; } -void Surface::SetDeviceScaleFactor(float device_scale_factor) { - device_scale_factor_ = device_scale_factor; -} - void Surface::Commit() { TRACE_EVENT0("exo", "Surface::Commit"); @@ -721,27 +715,34 @@ } void Surface::UpdateContentSize() { + gfx::Size content_size; gfx::Size buffer_size = current_resource_.size; gfx::SizeF scaled_buffer_size( gfx::ScaleSize(gfx::SizeF(buffer_size), 1.0f / state_.buffer_scale)); if (!state_.viewport.IsEmpty()) { - content_size_ = state_.viewport; + content_size = state_.viewport; } else if (!state_.crop.IsEmpty()) { DLOG_IF(WARNING, !gfx::IsExpressibleAsInt(state_.crop.width()) || !gfx::IsExpressibleAsInt(state_.crop.height())) << "Crop rectangle size (" << state_.crop.size().ToString() << ") most be expressible using integers when viewport is not set"; - content_size_ = gfx::ToCeiledSize(state_.crop.size()); + content_size = gfx::ToCeiledSize(state_.crop.size()); } else { - content_size_ = gfx::ToCeiledSize(scaled_buffer_size); + content_size = gfx::ToCeiledSize(scaled_buffer_size); } - window_->SetBounds(gfx::Rect(window_->bounds().origin(), content_size_)); // Enable/disable sub-surface based on if it has contents. if (has_contents()) window_->Show(); else window_->Hide(); + + if (content_size_ != content_size) { + content_size_ = content_size; + window_->SetBounds(gfx::Rect(window_->bounds().origin(), content_size_)); + if (delegate_) + delegate_->OnSurfaceContentSizeChanged(); + } } } // namespace exo
diff --git a/components/exo/surface.h b/components/exo/surface.h index c2c18f97..211d3ee 100644 --- a/components/exo/surface.h +++ b/components/exo/surface.h
@@ -125,9 +125,6 @@ // This sets the alpha value that will be applied to the whole surface. void SetAlpha(float alpha); - // This sets the device scale factor sent in CompositorFrames. - void SetDeviceScaleFactor(float device_scale_factor); - // Surface state (damage regions, attached buffers, etc.) is double-buffered. // A Commit() call atomically applies all pending state, replacing the // current state. Commit() is not guaranteed to be synchronous. See @@ -288,9 +285,6 @@ // The buffer that will become the content of surface when Commit() is called. BufferAttachment pending_buffer_; - // The device scale factor sent in CompositorFrames. - float device_scale_factor_ = 1.0f; - // The damage region to schedule paint for when Commit() is called. SkRegion pending_damage_;
diff --git a/components/exo/surface_delegate.h b/components/exo/surface_delegate.h index c4504855..2307cf2 100644 --- a/components/exo/surface_delegate.h +++ b/components/exo/surface_delegate.h
@@ -13,6 +13,9 @@ // Called when surface was requested to commit all double-buffered state. virtual void OnSurfaceCommit() = 0; + // Called when surface content size was changed. + virtual void OnSurfaceContentSizeChanged() = 0; + // Returns true if surface is in synchronized mode. ie. commit of // double-buffered state should be synchronized with parent surface. virtual bool IsSurfaceSynchronized() const = 0;
diff --git a/components/exo/surface_tree_host.cc b/components/exo/surface_tree_host.cc index d793219..b5a8266 100644 --- a/components/exo/surface_tree_host.cc +++ b/components/exo/surface_tree_host.cc
@@ -195,6 +195,11 @@ SubmitCompositorFrame(Surface::FRAME_TYPE_COMMIT); } +void SurfaceTreeHost::OnSurfaceContentSizeChanged() { + host_window_->SetBounds(gfx::Rect(host_window_->bounds().origin(), + root_surface_->content_size())); +} + bool SurfaceTreeHost::IsSurfaceSynchronized() const { // To host a surface tree, the root surface has to be desynchronized. DCHECK(root_surface_); @@ -274,10 +279,7 @@ } else { current_begin_frame_ack_.has_damage = true; } - frame.metadata.begin_frame_ack = current_begin_frame_ack_; - frame.metadata.device_scale_factor = - host_window_->layer()->device_scale_factor(); const int kRenderPassId = 1; std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); render_pass->SetNew(kRenderPassId, gfx::Rect(), gfx::Rect(), @@ -288,10 +290,10 @@ &frame_callbacks_, &presentation_callbacks_); frame.render_pass_list.back()->output_rect = gfx::Rect(root_surface_->content_size()); - host_window_->SetBounds(gfx::Rect(host_window_->bounds().origin(), - root_surface_->content_size())); host_window_->layer()->SetFillsBoundsOpaquely( root_surface_->FillsBoundsOpaquely()); + frame.metadata.device_scale_factor = + host_window_->layer()->device_scale_factor(); layer_tree_frame_sink_holder_->frame_sink()->SubmitCompositorFrame( std::move(frame));
diff --git a/components/exo/surface_tree_host.h b/components/exo/surface_tree_host.h index 92685a01..95ef9b1 100644 --- a/components/exo/surface_tree_host.h +++ b/components/exo/surface_tree_host.h
@@ -83,6 +83,7 @@ // Overridden from SurfaceDelegate: void OnSurfaceCommit() override; + void OnSurfaceContentSizeChanged() override; bool IsSurfaceSynchronized() const override; // Overridden from aura::WindowObserver:
diff --git a/components/nacl/browser/pnacl_host_unittest.cc b/components/nacl/browser/pnacl_host_unittest.cc index 992f607..1fcd3af 100644 --- a/components/nacl/browser/pnacl_host_unittest.cc +++ b/components/nacl/browser/pnacl_host_unittest.cc
@@ -19,6 +19,7 @@ #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" #include "net/base/test_completion_callback.h" +#include "net/disk_cache/disk_cache.h" #include "testing/gtest/include/gtest/gtest.h" #if defined(OS_WIN) @@ -52,6 +53,7 @@ // Give the host a chance to de-init the backend, and then delete it. host_->RendererClosing(0); content::RunAllBlockingPoolTasksUntilIdle(); + disk_cache::FlushCacheThreadForTesting(); EXPECT_EQ(PnaclHost::CacheUninitialized, host_->cache_state_); } int GetCacheSize() { return host_->disk_cache_->Size(); } @@ -458,7 +460,12 @@ // the first one runs. We can just shortcut and call DeInitIfSafe while the // cache is still initializing. DeInit(); + + // Now let it finish initializing. (Other tests don't need this since they + // use in-memory storage). + disk_cache::FlushCacheThreadForTesting(); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(CacheIsInitialized()); } } // namespace pnacl
diff --git a/components/nacl/browser/pnacl_translation_cache.cc b/components/nacl/browser/pnacl_translation_cache.cc index 1f71fe39..57cef8c77 100644 --- a/components/nacl/browser/pnacl_translation_cache.cc +++ b/components/nacl/browser/pnacl_translation_cache.cc
@@ -340,7 +340,6 @@ int rv = disk_cache::CreateCacheBackend( cache_type, net::CACHE_BACKEND_DEFAULT, cache_dir, cache_size, true /* force_initialize */, - BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE).get(), NULL, /* dummy net log */ &disk_cache_, base::Bind(&PnaclTranslationCache::OnCreateBackendComplete, AsWeakPtr()));
diff --git a/components/offline_pages/core/offline_event_logger.cc b/components/offline_pages/core/offline_event_logger.cc index 09d2b7f..62f89309 100644 --- a/components/offline_pages/core/offline_event_logger.cc +++ b/components/offline_pages/core/offline_event_logger.cc
@@ -33,6 +33,7 @@ } void OfflineEventLogger::RecordActivity(const std::string& activity) { + DVLOG(1) << activity; if (!is_logging_ || activity.empty()) return;
diff --git a/components/offline_pages/core/prefetch/BUILD.gn b/components/offline_pages/core/prefetch/BUILD.gn index 5368f00..f5f0f58 100644 --- a/components/offline_pages/core/prefetch/BUILD.gn +++ b/components/offline_pages/core/prefetch/BUILD.gn
@@ -28,12 +28,15 @@ "mark_operation_done_task.cc", "mark_operation_done_task.h", "offline_metrics_collector.h", + "page_bundle_update_task.cc", + "page_bundle_update_task.h", "prefetch_background_task_handler.h", "prefetch_dispatcher.h", "prefetch_dispatcher_impl.cc", "prefetch_dispatcher_impl.h", - "prefetch_downloader.cc", "prefetch_downloader.h", + "prefetch_downloader_impl.cc", + "prefetch_downloader_impl.h", "prefetch_gcm_app_handler.cc", "prefetch_gcm_app_handler.h", "prefetch_gcm_handler.h", @@ -143,8 +146,9 @@ "import_archives_task_unittest.cc", "import_completed_task_unittest.cc", "mark_operation_done_task_unittest.cc", + "page_bundle_update_task_unittest.cc", "prefetch_dispatcher_impl_unittest.cc", - "prefetch_downloader_unittest.cc", + "prefetch_downloader_impl_unittest.cc", "prefetch_gcm_app_handler_unittest.cc", "prefetch_item_unittest.cc", "prefetch_network_request_factory_impl_unittest.cc",
diff --git a/components/offline_pages/core/prefetch/mock_prefetch_item_generator.cc b/components/offline_pages/core/prefetch/mock_prefetch_item_generator.cc index 4a23fba..d213aaa 100644 --- a/components/offline_pages/core/prefetch/mock_prefetch_item_generator.cc +++ b/components/offline_pages/core/prefetch/mock_prefetch_item_generator.cc
@@ -35,7 +35,6 @@ // Values set with non prefix based values. new_item.state = state; - new_item.guid = base::GenerateGUID(); new_item.offline_id = GenerateTestOfflineId(); new_item.creation_time = base::Time::Now(); new_item.freshness_time = new_item.creation_time; @@ -45,20 +44,51 @@ client_namespace_, client_id_prefix_ + base::IntToString(item_counter)); new_item.url = GURL(url_prefix_ + base::IntToString(item_counter)); + ++item_counter; + if (state == PrefetchItemState::NEW_REQUEST || + state == PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE) { + return new_item; + } + // Values set only if prefixes are not empty. - if (final_url_prefix_.length()) - new_item.final_archived_url = - GURL(final_url_prefix_ + base::IntToString(item_counter)); - if (operation_name_prefix_.length()) + if (operation_name_prefix_.length()) { new_item.operation_name = operation_name_prefix_ + base::IntToString(item_counter); + } + + if (state == PrefetchItemState::AWAITING_GCM || + state == PrefetchItemState::RECEIVED_GCM || + state == PrefetchItemState::SENT_GET_OPERATION) { + return new_item; + } + if (archive_body_name_prefix_.length()) { new_item.archive_body_name = archive_body_name_prefix_ + base::IntToString(item_counter); new_item.archive_body_length = item_counter * 100; } - ++item_counter; + if (final_url_prefix_.length()) { + new_item.final_archived_url = + GURL(final_url_prefix_ + base::IntToString(item_counter)); + } + if (state == PrefetchItemState::RECEIVED_BUNDLE) + return new_item; + + new_item.guid = base::GenerateGUID(); + + if (state == PrefetchItemState::DOWNLOADING || + state == PrefetchItemState::DOWNLOADED || + state == PrefetchItemState::IMPORTING || + state == PrefetchItemState::FINISHED || + state == PrefetchItemState::ZOMBIE) { + return new_item; + } + + // This code should explicitly account for all states so adding a new one will + // cause this to crash in debug mode. + NOTREACHED(); + return new_item; }
diff --git a/components/offline_pages/core/prefetch/mock_prefetch_item_generator.h b/components/offline_pages/core/prefetch/mock_prefetch_item_generator.h index cd8cf3b..bb53138 100644 --- a/components/offline_pages/core/prefetch/mock_prefetch_item_generator.h +++ b/components/offline_pages/core/prefetch/mock_prefetch_item_generator.h
@@ -15,7 +15,10 @@ // Generator of PrefetchItem instances with all fields automatically // pre-populated with values that are reasonable and unique (within the // instance). To further customize returned items one can set custom prefixes or -// just change the actual values of returned instances. +// just change the actual values of returned instances. When creating an item +// with a particular state, only the fields applicable to that state will be +// populated, and the rest will remain in their default state, even if prefixes +// are set for that data member. class MockPrefetchItemGenerator { public: static const std::string kClientNamespace;
diff --git a/components/offline_pages/core/prefetch/page_bundle_update_task.cc b/components/offline_pages/core/prefetch/page_bundle_update_task.cc new file mode 100644 index 0000000..e80240a --- /dev/null +++ b/components/offline_pages/core/prefetch/page_bundle_update_task.cc
@@ -0,0 +1,200 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/offline_pages/core/prefetch/page_bundle_update_task.h" + +#include <memory> +#include <string> +#include <vector> + +#include "base/memory/weak_ptr.h" +#include "components/offline_pages/core/prefetch/prefetch_dispatcher.h" +#include "components/offline_pages/core/prefetch/prefetch_service.h" +#include "components/offline_pages/core/prefetch/prefetch_types.h" +#include "components/offline_pages/core/prefetch/store/prefetch_store.h" +#include "sql/connection.h" +#include "sql/statement.h" +#include "sql/transaction.h" + +namespace offline_pages { +using PageBundleUpdateResult = PageBundleUpdateTask::PageBundleUpdateResult; + +namespace { + +// Marks a successfully rendered URL as having received the bundle, and returns +// whether any records matched the given RenderPageInfo. +bool MarkUrlRenderedSync(sql::Connection* db, + const RenderPageInfo& page, + const std::string& operation_name) { + DCHECK_EQ(page.status, RenderStatus::RENDERED); + + // If the operation name is empty, then we assume this is from a + // GeneratePageBundle request, so we don't need to match because the incoming + // operation name is the new operation name for unfinished entries in the + // newest batch. + static const char kSql[] = R"(UPDATE prefetch_items + SET state = ?, + final_archived_url = ?, + archive_body_name = ?, + archive_body_length = ? + WHERE requested_url = ? AND ( + (state = ? AND operation_name = "") OR + (state = ? AND operation_name = ?) + ) + )"; + + sql::Statement statement(db->GetCachedStatement(SQL_FROM_HERE, kSql)); + DCHECK(statement.is_valid()); + + std::string final_url = page.redirect_url; + if (final_url == page.url) + final_url = ""; + + // SET + statement.BindInt(0, static_cast<int>(PrefetchItemState::RECEIVED_BUNDLE)); + statement.BindString(1, final_url); + statement.BindString(2, page.body_name); + statement.BindInt64(3, page.body_length); + + // WHERE + statement.BindString(4, page.url); + statement.BindInt( + 5, static_cast<int>(PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE)); + statement.BindInt(6, static_cast<int>(PrefetchItemState::SENT_GET_OPERATION)); + statement.BindString(7, operation_name); + + if (!statement.Run()) + return false; + + return db->GetLastChangeCount() > 0; +} + +// Marks a URL that failed to render as finished. +void MarkUrlFailedSync(sql::Connection* db, + const RenderPageInfo& page, + const std::string& operation_name, + PrefetchItemErrorCode final_status) { + DCHECK_NE(page.status, RenderStatus::RENDERED); + + static const char kSql[] = R"(UPDATE prefetch_items + SET state = ?, + error_code = ? + WHERE requested_url = ? AND ( + (state = ? AND operation_name = "") OR + (state = ? AND operation_name = ?) + ) + )"; + + sql::Statement statement(db->GetCachedStatement(SQL_FROM_HERE, kSql)); + DCHECK(statement.is_valid()); + + std::string final_url = page.redirect_url; + if (final_url.empty()) + final_url = page.url; + + // SET + statement.BindInt(0, static_cast<int>(PrefetchItemState::FINISHED)); + statement.BindInt(1, static_cast<int>(final_status)); + + // WHERE + statement.BindString(2, page.url); + statement.BindInt( + 3, static_cast<int>(PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE)); + statement.BindInt(4, static_cast<int>(PrefetchItemState::SENT_GET_OPERATION)); + statement.BindString(5, operation_name); + + statement.Run(); +} + +// Marks URLs known to be PENDING as awaiting GCM. +void MarkAwaitingGCMSync(sql::Connection* db, + const RenderPageInfo& page, + const std::string& operation_name) { + static const char kSql[] = R"(UPDATE prefetch_items + SET state = ?, + operation_name = ? + WHERE state = ? AND requested_url = ? + )"; + + sql::Statement statement(db->GetCachedStatement(SQL_FROM_HERE, kSql)); + DCHECK(statement.is_valid()); + + // SET + statement.BindInt(0, static_cast<int>(PrefetchItemState::AWAITING_GCM)); + statement.BindString(1, operation_name); + + // WHERE + statement.BindInt( + 2, static_cast<int>(PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE)); + statement.BindString(3, page.url); + + statement.Run(); +} + +// Individually updates all pages for the given operation +PageBundleUpdateResult UpdateWithOperationResultsSync( + const std::string operation_name, + const std::vector<RenderPageInfo>& pages, + sql::Connection* db) { + sql::Transaction transaction(db); + if (!transaction.Begin()) + return false; + + bool schedule_pipeline_processing = false; + + for (auto& page : pages) { + switch (page.status) { + case RenderStatus::RENDERED: + if (MarkUrlRenderedSync(db, page, operation_name)) + schedule_pipeline_processing = true; + break; + case RenderStatus::FAILED: + MarkUrlFailedSync(db, page, operation_name, + PrefetchItemErrorCode::ARCHIVING_FAILED); + break; + case RenderStatus::EXCEEDED_LIMIT: + MarkUrlFailedSync(db, page, operation_name, + PrefetchItemErrorCode::ARCHIVING_LIMIT_EXCEEDED); + break; + case RenderStatus::PENDING: + MarkAwaitingGCMSync(db, page, operation_name); + break; + } + } + + return transaction.Commit() && schedule_pipeline_processing; +} + +} // namespace + +PageBundleUpdateTask::PageBundleUpdateTask( + PrefetchStore* store, + PrefetchDispatcher* dispatcher, + const std::string& operation_name, + const std::vector<RenderPageInfo>& pages) + : store_(store), + dispatcher_(dispatcher), + operation_name_(operation_name), + pages_(pages), + weak_factory_(this) { + DCHECK(store_); +} + +PageBundleUpdateTask::~PageBundleUpdateTask() = default; + +void PageBundleUpdateTask::Run() { + store_->Execute( + base::BindOnce(&UpdateWithOperationResultsSync, operation_name_, pages_), + base::BindOnce(&PageBundleUpdateTask::FinishedWork, + weak_factory_.GetWeakPtr())); +} + +void PageBundleUpdateTask::FinishedWork( + PageBundleUpdateResult needs_pipeline_processing) { + if (needs_pipeline_processing) + dispatcher_->SchedulePipelineProcessing(); + TaskComplete(); +} + +} // namespace offline_pages
diff --git a/components/offline_pages/core/prefetch/page_bundle_update_task.h b/components/offline_pages/core/prefetch/page_bundle_update_task.h new file mode 100644 index 0000000..88ca890 --- /dev/null +++ b/components/offline_pages/core/prefetch/page_bundle_update_task.h
@@ -0,0 +1,68 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PAGE_BUNDLE_UPDATE_TASK_H_ +#define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PAGE_BUNDLE_UPDATE_TASK_H_ + +#include <string> +#include <vector> + +#include "base/memory/weak_ptr.h" +#include "components/offline_pages/core/prefetch/prefetch_types.h" +#include "components/offline_pages/core/task.h" + +namespace offline_pages { +class PrefetchDispatcher; +class PrefetchStore; + +// Task that writes down the result of a prefetch networking operation and +// optionally schedules action tasks. Results in the form of |operation_name| +// and vector of |RenderPageInfo| are provided in both GetOperation and +// GeneratePageBundle responses. +// +// This task does 3 things: +// - Any pages in the |pages| list that have succeeded are updated to +// RECEIVED_BUNDLE and body name / length are updated. +// - Any pages in the |pages| list that failed are updated to FINISHED +// with the ARCHIVING_FAILED error code. +// - Any pages in the result that are "Pending" and match rows with an +// empty operation name will update to AWAITING_GCM and save the +// operation name. +// - Pages in the SENT_GENERATE_PAGE_BUNDLE or SENT_GET_OPERATION state but that +// are not reflected in the |pages| list are ignored, and will be cleaned up +// by reconcilers if necessary. +class PageBundleUpdateTask : public Task { + public: + // The result is whether we need more action tasks to run right now. + using PageBundleUpdateResult = bool; + + PageBundleUpdateTask(PrefetchStore* store, + PrefetchDispatcher* dispatcher, + const std::string& operation_name, + const std::vector<RenderPageInfo>& pages); + ~PageBundleUpdateTask() override; + + // Task implementation. + void Run() override; + + private: + void FinishedWork(PageBundleUpdateResult result); + + // Owned by PrefetchService which also transitively owns |this|, so raw + // pointer is OK. + PrefetchStore* store_; + // PrefetchDispatcher owns the task queue which owns |this|, so raw pointer is + // OK. + PrefetchDispatcher* dispatcher_; + std::string operation_name_; + std::vector<RenderPageInfo> pages_; + + base::WeakPtrFactory<PageBundleUpdateTask> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(PageBundleUpdateTask); +}; + +} // namespace offline_pages + +#endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PAGE_BUNDLE_UPDATE_TASK_H_
diff --git a/components/offline_pages/core/prefetch/page_bundle_update_task_unittest.cc b/components/offline_pages/core/prefetch/page_bundle_update_task_unittest.cc new file mode 100644 index 0000000..608ed57 --- /dev/null +++ b/components/offline_pages/core/prefetch/page_bundle_update_task_unittest.cc
@@ -0,0 +1,250 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/offline_pages/core/prefetch/page_bundle_update_task.h" + +#include "base/logging.h" +#include "base/test/mock_callback.h" +#include "components/offline_pages/core/prefetch/prefetch_item.h" +#include "components/offline_pages/core/prefetch/prefetch_types.h" +#include "components/offline_pages/core/prefetch/store/prefetch_store.h" +#include "components/offline_pages/core/prefetch/store/prefetch_store_test_util.h" +#include "components/offline_pages/core/prefetch/store/prefetch_store_utils.h" +#include "components/offline_pages/core/prefetch/task_test_base.h" +#include "components/offline_pages/core/prefetch/test_prefetch_dispatcher.h" +#include "components/offline_pages/core/task.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +using testing::HasSubstr; + +namespace offline_pages { + +class PageBundleUpdateTaskTest : public TaskTestBase { + public: + PageBundleUpdateTaskTest() = default; + ~PageBundleUpdateTaskTest() override = default; + + TestPrefetchDispatcher dispatcher; + + RenderPageInfo FailedPageInfoForPrefetchItem(const PrefetchItem& item) { + RenderPageInfo rv; + + rv.url = item.url.spec(); + rv.status = RenderStatus::FAILED; + return rv; + } + + RenderPageInfo PendingPageInfoForPrefetchItem(const PrefetchItem& item) { + RenderPageInfo rv; + + rv.url = item.url.spec(); + rv.status = RenderStatus::PENDING; + return rv; + } + + RenderPageInfo RenderedPageInfoForPrefetchItem(const PrefetchItem& item) { + RenderPageInfo rv; + + rv.url = item.url.spec(); + rv.status = RenderStatus::RENDERED; + rv.body_name = std::to_string(++body_name_count_); + rv.body_length = 1024 + body_name_count_; // a realistic number of bytes + + rv.render_time = base::Time::Now(); + return rv; + } + + private: + int body_name_count_ = 0; +}; + +TEST_F(PageBundleUpdateTaskTest, EmptyTask) { + PageBundleUpdateTask task(store(), &dispatcher, "operation", {}); + ExpectTaskCompletes(&task); + + task.Run(); + RunUntilIdle(); + EXPECT_EQ(0, dispatcher.processing_schedule_count); +} + +TEST_F(PageBundleUpdateTaskTest, UpdatesItemsFromSentGeneratePageBundle) { + // Tests that SENT_GENERATE_PAGE_BUNDLE can correctly transition pages to + // RECEIVED_BUNDLE. + PrefetchItem item1 = item_generator()->CreateItem( + PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE); + ASSERT_EQ("", item1.operation_name); + PrefetchItem item2 = + item_generator()->CreateItem(PrefetchItemState::AWAITING_GCM); + ASSERT_NE("", item2.operation_name); + ASSERT_TRUE(store_util()->InsertPrefetchItem(item1)); + ASSERT_TRUE(store_util()->InsertPrefetchItem(item2)); + ASSERT_EQ(2, store_util()->CountPrefetchItems()); + + // We assume that the bundle contains items for two entries, but one of those + // entries is not in the correct state to be updated (different operation + // name). + PageBundleUpdateTask task(store(), &dispatcher, "operation", + { + RenderedPageInfoForPrefetchItem(item1), + RenderedPageInfoForPrefetchItem(item2), + }); + ExpectTaskCompletes(&task); + task.Run(); + RunUntilIdle(); + + // The matching entry has been updated. + EXPECT_EQ(PrefetchItemState::RECEIVED_BUNDLE, + store_util()->GetPrefetchItem(item1.offline_id)->state); + EXPECT_NE("", + store_util()->GetPrefetchItem(item1.offline_id)->archive_body_name); + EXPECT_LT( + 0, store_util()->GetPrefetchItem(item1.offline_id)->archive_body_length); + // The non-matching entry has not changed. + EXPECT_EQ(item2, *(store_util()->GetPrefetchItem(item2.offline_id))); + // The dispatcher knows to reschedule the action tasks. + EXPECT_LE(1, dispatcher.processing_schedule_count); +} + +TEST_F(PageBundleUpdateTaskTest, SentGetOperationToReceivedBundle) { + PrefetchItem item1 = + item_generator()->CreateItem(PrefetchItemState::SENT_GET_OPERATION); + ASSERT_EQ("", item1.archive_body_name); + ASSERT_EQ(-1, item1.archive_body_length); + + ASSERT_TRUE(store_util()->InsertPrefetchItem(item1)); + + PageBundleUpdateTask task(store(), &dispatcher, item1.operation_name, + { + RenderedPageInfoForPrefetchItem(item1), + }); + ExpectTaskCompletes(&task); + task.Run(); + RunUntilIdle(); + + // The matching entry has been updated. + EXPECT_EQ(store_util()->GetPrefetchItem(item1.offline_id)->state, + PrefetchItemState::RECEIVED_BUNDLE); + EXPECT_NE("", + store_util()->GetPrefetchItem(item1.offline_id)->archive_body_name); + EXPECT_LT( + 0, store_util()->GetPrefetchItem(item1.offline_id)->archive_body_length); + EXPECT_LE(1, dispatcher.processing_schedule_count); +} + +TEST_F(PageBundleUpdateTaskTest, UrlDoesNotMatch) { + // Tests that no change happens if the URLs passed into the task don't match + // the ones in the store. + PrefetchItem item = item_generator()->CreateItem( + PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE); + ASSERT_TRUE(store_util()->InsertPrefetchItem(item)); + + // Dummy item not inserted into store. + PrefetchItem item2 = item_generator()->CreateItem( + PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE); + + ASSERT_NE(item.url, item2.url); + + PageBundleUpdateTask task(store(), &dispatcher, "operation", + { + RenderedPageInfoForPrefetchItem(item2), + }); + ExpectTaskCompletes(&task); + task.Run(); + RunUntilIdle(); + EXPECT_EQ(item, *(store_util()->GetPrefetchItem(item.offline_id))); + EXPECT_EQ(0, dispatcher.processing_schedule_count); +} + +TEST_F(PageBundleUpdateTaskTest, PendingRenderAwaitsGCM) { + // Tests that the transition to AWAITING_GCM happens correctly from + // SENT_GENERATE_PAGE_BUNDLE. + PrefetchItem item = item_generator()->CreateItem( + PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE); + ASSERT_EQ("", item.operation_name); + ASSERT_TRUE(store_util()->InsertPrefetchItem(item)); + + PageBundleUpdateTask task(store(), &dispatcher, "operation", + { + PendingPageInfoForPrefetchItem(item), + }); + ExpectTaskCompletes(&task); + task.Run(); + RunUntilIdle(); + + EXPECT_EQ(PrefetchItemState::AWAITING_GCM, + store_util()->GetPrefetchItem(item.offline_id)->state); + EXPECT_EQ("operation", + store_util()->GetPrefetchItem(item.offline_id)->operation_name); + EXPECT_EQ(0, dispatcher.processing_schedule_count); +} + +TEST_F(PageBundleUpdateTaskTest, FailedRenderToFinished) { + // Tests one item with a archiving failed result, and one with a limit + // exceeded result. + PrefetchItem item1 = item_generator()->CreateItem( + PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE); + ASSERT_EQ(PrefetchItemErrorCode::SUCCESS, item1.error_code); + ASSERT_TRUE(store_util()->InsertPrefetchItem(item1)); + RenderPageInfo item1_render_info = FailedPageInfoForPrefetchItem(item1); + + PrefetchItem item2 = item_generator()->CreateItem( + PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE); + ASSERT_EQ(PrefetchItemErrorCode::SUCCESS, item2.error_code); + ASSERT_TRUE(store_util()->InsertPrefetchItem(item2)); + RenderPageInfo item2_render_info = FailedPageInfoForPrefetchItem(item2); + item2_render_info.status = RenderStatus::EXCEEDED_LIMIT; + PageBundleUpdateTask task(store(), &dispatcher, "operation", + {item2_render_info, item1_render_info}); + ExpectTaskCompletes(&task); + task.Run(); + RunUntilIdle(); + + EXPECT_EQ(PrefetchItemState::FINISHED, + store_util()->GetPrefetchItem(item1.offline_id)->state); + EXPECT_EQ(PrefetchItemErrorCode::ARCHIVING_FAILED, + store_util()->GetPrefetchItem(item1.offline_id)->error_code); + + EXPECT_EQ(PrefetchItemState::FINISHED, + store_util()->GetPrefetchItem(item2.offline_id)->state); + EXPECT_EQ(PrefetchItemErrorCode::ARCHIVING_LIMIT_EXCEEDED, + store_util()->GetPrefetchItem(item2.offline_id)->error_code); + EXPECT_EQ(0, dispatcher.processing_schedule_count); +} + +TEST_F(PageBundleUpdateTaskTest, MixOfResults) { + // Tests that 3 items all with different render results get updated + // independently and properly. + PrefetchItem item1 = item_generator()->CreateItem( + PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE); + ASSERT_TRUE(store_util()->InsertPrefetchItem(item1)); + RenderPageInfo item1_render_info = PendingPageInfoForPrefetchItem(item1); + + PrefetchItem item2 = item_generator()->CreateItem( + PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE); + ASSERT_TRUE(store_util()->InsertPrefetchItem(item2)); + RenderPageInfo item2_render_info = FailedPageInfoForPrefetchItem(item2); + + PrefetchItem item3 = item_generator()->CreateItem( + PrefetchItemState::SENT_GENERATE_PAGE_BUNDLE); + ASSERT_TRUE(store_util()->InsertPrefetchItem(item3)); + RenderPageInfo item3_render_info = RenderedPageInfoForPrefetchItem(item3); + + PageBundleUpdateTask task( + store(), &dispatcher, "operation", + {item3_render_info, item2_render_info, item1_render_info}); + ExpectTaskCompletes(&task); + task.Run(); + RunUntilIdle(); + + EXPECT_EQ(PrefetchItemState::AWAITING_GCM, + store_util()->GetPrefetchItem(item1.offline_id)->state); + EXPECT_EQ(PrefetchItemState::FINISHED, + store_util()->GetPrefetchItem(item2.offline_id)->state); + EXPECT_EQ(PrefetchItemState::RECEIVED_BUNDLE, + store_util()->GetPrefetchItem(item3.offline_id)->state); + EXPECT_LE(1, dispatcher.processing_schedule_count); +} + +} // namespace offline_pages
diff --git a/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc b/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc index f1f5aac..d0905a2 100644 --- a/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc +++ b/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc
@@ -21,6 +21,7 @@ #include "components/offline_pages/core/prefetch/import_archives_task.h" #include "components/offline_pages/core/prefetch/import_completed_task.h" #include "components/offline_pages/core/prefetch/mark_operation_done_task.h" +#include "components/offline_pages/core/prefetch/page_bundle_update_task.h" #include "components/offline_pages/core/prefetch/prefetch_background_task_handler.h" #include "components/offline_pages/core/prefetch/prefetch_gcm_handler.h" #include "components/offline_pages/core/prefetch/prefetch_importer.h" @@ -89,6 +90,7 @@ std::unique_ptr<ScopedBackgroundTask> background_task) { if (!IsPrefetchingOfflinePagesEnabled()) return; + service_->GetLogger()->RecordActivity("Beginning Background Task."); background_task_ = std::move(background_task); @@ -165,6 +167,9 @@ PrefetchRequestStatus status, const std::string& operation_name, const std::vector<RenderPageInfo>& pages) { + PrefetchStore* prefetch_store = service_->GetPrefetchStore(); + task_queue_.AddTask(base::MakeUnique<PageBundleUpdateTask>( + prefetch_store, this, operation_name, pages)); LogRequestResult("GeneratePageBundleRequest", status, operation_name, pages); } @@ -172,6 +177,9 @@ PrefetchRequestStatus status, const std::string& operation_name, const std::vector<RenderPageInfo>& pages) { + PrefetchStore* prefetch_store = service_->GetPrefetchStore(); + task_queue_.AddTask(base::MakeUnique<PageBundleUpdateTask>( + prefetch_store, this, operation_name, pages)); LogRequestResult("GetOperationRequest", status, operation_name, pages); }
diff --git a/components/offline_pages/core/prefetch/prefetch_downloader.h b/components/offline_pages/core/prefetch/prefetch_downloader.h index 4dd0f24..4e7fc53 100644 --- a/components/offline_pages/core/prefetch/prefetch_downloader.h +++ b/components/offline_pages/core/prefetch/prefetch_downloader.h
@@ -6,89 +6,42 @@ #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DOWNLOADER_H_ #include <string> -#include <utility> -#include <vector> #include "base/callback.h" -#include "base/macros.h" -#include "base/memory/weak_ptr.h" -#include "components/download/public/download_params.h" #include "components/offline_pages/core/prefetch/prefetch_types.h" -#include "components/version_info/channel.h" - -namespace download { -class DownloadService; -} // namespace download namespace offline_pages { -class PrefetchServiceTestTaco; - // Asynchronously downloads the archive. class PrefetchDownloader { public: - PrefetchDownloader(download::DownloadService* download_service, - version_info::Channel channel); - ~PrefetchDownloader(); + virtual ~PrefetchDownloader() = default; - void SetCompletedCallback(const PrefetchDownloadCompletedCallback& callback); + virtual void SetCompletedCallback( + const PrefetchDownloadCompletedCallback& callback) = 0; // Starts to download an archive from |download_location|. - void StartDownload(const std::string& download_id, - const std::string& download_location); + virtual void StartDownload(const std::string& download_id, + const std::string& download_location) = 0; // Cancels a previous scheduled download. - void CancelDownload(const std::string& download_id); - - // Responding to download client event. + virtual void CancelDownload(const std::string& download_id) = 0; // Called when the download service is initialized and can accept the // downloads. - void OnDownloadServiceReady(); + virtual void OnDownloadServiceReady() = 0; // Called when the download service is tearing down. - void OnDownloadServiceShutdown(); + virtual void OnDownloadServiceShutdown() = 0; // Called when a download is completed successfully. Note that the download - // can be scheduled in preious sessions. - void OnDownloadSucceeded(const std::string& download_id, - const base::FilePath& file_path, - uint64_t file_size); + // can be scheduled in previous sessions. + virtual void OnDownloadSucceeded(const std::string& download_id, + const base::FilePath& file_path, + uint64_t file_size) = 0; // Called when a download fails. - void OnDownloadFailed(const std::string& download_id); - - private: - friend class PrefetchServiceTestTaco; - - // For test only. - explicit PrefetchDownloader(version_info::Channel channel); - - // Callback for StartDownload. - void OnStartDownload(const std::string& download_id, - download::DownloadParams::StartResult result); - - // Unowned. It is valid until |this| instance is disposed. - download::DownloadService* download_service_; - - version_info::Channel channel_; - PrefetchDownloadCompletedCallback callback_; - - // Flag to indicate if the download service is ready to take downloads. - bool service_started_ = false; - - // TODO(jianli): Investigate making PrefetchService waits for DownloadService - // ready in order to avoid queueing. - // List of downloads pending to start after the download service starts. Each - // item is a pair of download id and download location. - std::vector<std::pair<std::string, std::string>> pending_downloads_; - // List of ids of downloads waiting to be cancelled after the download service - // starts. - std::vector<std::string> pending_cancellations_; - - base::WeakPtrFactory<PrefetchDownloader> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(PrefetchDownloader); + virtual void OnDownloadFailed(const std::string& download_id) = 0; }; } // namespace offline_pages
diff --git a/components/offline_pages/core/prefetch/prefetch_downloader.cc b/components/offline_pages/core/prefetch/prefetch_downloader_impl.cc similarity index 76% rename from components/offline_pages/core/prefetch/prefetch_downloader.cc rename to components/offline_pages/core/prefetch/prefetch_downloader_impl.cc index 47f0591..76eaecb 100644 --- a/components/offline_pages/core/prefetch/prefetch_downloader.cc +++ b/components/offline_pages/core/prefetch/prefetch_downloader_impl.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/offline_pages/core/prefetch/prefetch_downloader.h" +#include "components/offline_pages/core/prefetch/prefetch_downloader_impl.h" #include "base/bind.h" #include "base/logging.h" @@ -14,7 +14,7 @@ namespace offline_pages { -PrefetchDownloader::PrefetchDownloader( +PrefetchDownloaderImpl::PrefetchDownloaderImpl( download::DownloadService* download_service, version_info::Channel channel) : download_service_(download_service), @@ -25,18 +25,19 @@ download::DownloadService::ServiceStatus::READY; } -PrefetchDownloader::PrefetchDownloader(version_info::Channel channel) - : channel_(channel), weak_ptr_factory_(this) {} +PrefetchDownloaderImpl::PrefetchDownloaderImpl(version_info::Channel channel) + : download_service_(nullptr), channel_(channel), weak_ptr_factory_(this) {} -PrefetchDownloader::~PrefetchDownloader() = default; +PrefetchDownloaderImpl::~PrefetchDownloaderImpl() = default; -void PrefetchDownloader::SetCompletedCallback( +void PrefetchDownloaderImpl::SetCompletedCallback( const PrefetchDownloadCompletedCallback& callback) { callback_ = callback; } -void PrefetchDownloader::StartDownload(const std::string& download_id, - const std::string& download_location) { +void PrefetchDownloaderImpl::StartDownload( + const std::string& download_id, + const std::string& download_location) { if (!service_started_) { pending_downloads_.push_back( std::make_pair(download_id, download_location)); @@ -52,13 +53,13 @@ // TODO(jianli): Remove the uppercase after the download service fixes // this issue. params.guid = base::ToUpperASCII(download_id); - params.callback = base::Bind(&PrefetchDownloader::OnStartDownload, + params.callback = base::Bind(&PrefetchDownloaderImpl::OnStartDownload, weak_ptr_factory_.GetWeakPtr()); params.request_params.url = PrefetchDownloadURL(download_location, channel_); download_service_->StartDownload(params); } -void PrefetchDownloader::CancelDownload(const std::string& download_id) { +void PrefetchDownloaderImpl::CancelDownload(const std::string& download_id) { if (service_started_) { download_service_->CancelDownload(download_id); return; @@ -73,7 +74,7 @@ pending_cancellations_.push_back(download_id); } -void PrefetchDownloader::OnDownloadServiceReady() { +void PrefetchDownloaderImpl::OnDownloadServiceReady() { DCHECK_EQ(download::DownloadService::ServiceStatus::READY, download_service_->GetStatus()); service_started_ = true; @@ -87,13 +88,14 @@ pending_cancellations_.clear(); } -void PrefetchDownloader::OnDownloadServiceShutdown() { +void PrefetchDownloaderImpl::OnDownloadServiceShutdown() { service_started_ = false; } -void PrefetchDownloader::OnDownloadSucceeded(const std::string& download_id, - const base::FilePath& file_path, - uint64_t file_size) { +void PrefetchDownloaderImpl::OnDownloadSucceeded( + const std::string& download_id, + const base::FilePath& file_path, + uint64_t file_size) { // The file is not likely to be that big. Treat it as error if so. if (file_size > static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) { OnDownloadFailed(download_id); @@ -106,7 +108,7 @@ } } -void PrefetchDownloader::OnDownloadFailed(const std::string& download_id) { +void PrefetchDownloaderImpl::OnDownloadFailed(const std::string& download_id) { if (callback_) { PrefetchDownloadResult result; result.download_id = download_id; @@ -114,7 +116,7 @@ } } -void PrefetchDownloader::OnStartDownload( +void PrefetchDownloaderImpl::OnStartDownload( const std::string& download_id, download::DownloadParams::StartResult result) { if (result != download::DownloadParams::StartResult::ACCEPTED)
diff --git a/components/offline_pages/core/prefetch/prefetch_downloader_impl.h b/components/offline_pages/core/prefetch/prefetch_downloader_impl.h new file mode 100644 index 0000000..f1290a8 --- /dev/null +++ b/components/offline_pages/core/prefetch/prefetch_downloader_impl.h
@@ -0,0 +1,83 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DOWNLOADER_IMPL_H_ +#define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DOWNLOADER_IMPL_H_ + +#include <string> +#include <utility> +#include <vector> + +#include "base/callback.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "components/download/public/download_params.h" +#include "components/offline_pages/core/prefetch/prefetch_downloader.h" +#include "components/offline_pages/core/prefetch/prefetch_types.h" +#include "components/version_info/channel.h" + +namespace download { +class DownloadService; +} // namespace download + +namespace offline_pages { + +class PrefetchServiceTestTaco; + +// Asynchronously downloads the archive. +class PrefetchDownloaderImpl : public PrefetchDownloader { + public: + PrefetchDownloaderImpl(download::DownloadService* download_service, + version_info::Channel channel); + ~PrefetchDownloaderImpl() override; + + // PrefetchDownloader implementation: + void SetCompletedCallback( + const PrefetchDownloadCompletedCallback& callback) override; + void StartDownload(const std::string& download_id, + const std::string& download_location) override; + void CancelDownload(const std::string& download_id) override; + void OnDownloadServiceReady() override; + void OnDownloadServiceShutdown() override; + void OnDownloadSucceeded(const std::string& download_id, + const base::FilePath& file_path, + uint64_t file_size) override; + void OnDownloadFailed(const std::string& download_id) override; + + private: + friend class PrefetchServiceTestTaco; + + // For test only. + explicit PrefetchDownloaderImpl(version_info::Channel channel); + + // Callback for StartDownload. + void OnStartDownload(const std::string& download_id, + download::DownloadParams::StartResult result); + + // Unowned. It is valid until |this| instance is disposed. + download::DownloadService* download_service_; + + version_info::Channel channel_; + PrefetchDownloadCompletedCallback callback_; + + // Flag to indicate if the download service is ready to take downloads. + bool service_started_ = false; + + // TODO(jianli): Investigate making PrefetchService waits for DownloadService + // ready in order to avoid queueing. + // List of downloads pending to start after the download service starts. Each + // item is a pair of download id and download location. + std::vector<std::pair<std::string, std::string>> pending_downloads_; + // List of ids of downloads waiting to be cancelled after the download service + // starts. + std::vector<std::string> pending_cancellations_; + + base::WeakPtrFactory<PrefetchDownloaderImpl> weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(PrefetchDownloaderImpl); +}; + +} // namespace offline_pages + +#endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DOWNLOADER_IMPL_H_
diff --git a/components/offline_pages/core/prefetch/prefetch_downloader_unittest.cc b/components/offline_pages/core/prefetch/prefetch_downloader_impl_unittest.cc similarity index 97% rename from components/offline_pages/core/prefetch/prefetch_downloader_unittest.cc rename to components/offline_pages/core/prefetch/prefetch_downloader_impl_unittest.cc index afc7e01..9f81879 100644 --- a/components/offline_pages/core/prefetch/prefetch_downloader_unittest.cc +++ b/components/offline_pages/core/prefetch/prefetch_downloader_impl_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/offline_pages/core/prefetch/prefetch_downloader.h" +#include "components/offline_pages/core/prefetch/prefetch_downloader_impl.h" #include <list> #include <utility> @@ -99,7 +99,7 @@ void set_ready(bool ready) { ready_ = ready; } void set_prefetch_downloader( - offline_pages::PrefetchDownloader* prefetch_downloader) { + offline_pages::PrefetchDownloaderImpl* prefetch_downloader) { prefetch_downloader_ = prefetch_downloader; } @@ -128,7 +128,7 @@ } bool ready_ = false; - offline_pages::PrefetchDownloader* prefetch_downloader_ = nullptr; + offline_pages::PrefetchDownloaderImpl* prefetch_downloader_ = nullptr; TestServiceConfig service_config_; std::list<DownloadParams> downloads_; @@ -147,8 +147,8 @@ void SetUp() override { prefetch_service_taco_.reset(new PrefetchServiceTestTaco); - auto downloader = - base::MakeUnique<PrefetchDownloader>(&download_service_, kTestChannel); + auto downloader = base::MakeUnique<PrefetchDownloaderImpl>( + &download_service_, kTestChannel); download_service_.set_prefetch_downloader(downloader.get()); prefetch_service_taco_->SetPrefetchDownloader(std::move(downloader));
diff --git a/components/offline_pages/core/prefetch/prefetch_service_test_taco.cc b/components/offline_pages/core/prefetch/prefetch_service_test_taco.cc index 26fa77b..b3771595 100644 --- a/components/offline_pages/core/prefetch/prefetch_service_test_taco.cc +++ b/components/offline_pages/core/prefetch/prefetch_service_test_taco.cc
@@ -13,6 +13,7 @@ #include "components/offline_pages/core/prefetch/prefetch_background_task_handler.h" #include "components/offline_pages/core/prefetch/prefetch_dispatcher.h" #include "components/offline_pages/core/prefetch/prefetch_downloader.h" +#include "components/offline_pages/core/prefetch/prefetch_downloader_impl.h" #include "components/offline_pages/core/prefetch/prefetch_gcm_handler.h" #include "components/offline_pages/core/prefetch/prefetch_importer.h" #include "components/offline_pages/core/prefetch/prefetch_service_impl.h" @@ -56,7 +57,8 @@ prefetch_store_sql_ = base::MakeUnique<PrefetchStore>(base::ThreadTaskRunnerHandle::Get()); suggested_articles_observer_ = base::MakeUnique<SuggestedArticlesObserver>(); - prefetch_downloader_ = base::WrapUnique(new PrefetchDownloader(kTestChannel)); + prefetch_downloader_ = + base::WrapUnique(new PrefetchDownloaderImpl(kTestChannel)); prefetch_importer_ = base::MakeUnique<TestPrefetchImporter>(); // This sets up the testing articles as an empty vector, we can ignore the // result here. This allows us to not create a ContentSuggestionsService.
diff --git a/components/offline_pages/core/prefetch/prefetch_types.h b/components/offline_pages/core/prefetch/prefetch_types.h index 55a7cb7..415135d 100644 --- a/components/offline_pages/core/prefetch/prefetch_types.h +++ b/components/offline_pages/core/prefetch/prefetch_types.h
@@ -69,7 +69,7 @@ // might be skipped. enum class PrefetchItemState { // New request just received from the client. - NEW_REQUEST, + NEW_REQUEST = 0, // The item has been included in a GeneratePageBundle RPC requesting the // creation of an archive for its URL. SENT_GENERATE_PAGE_BUNDLE, @@ -113,6 +113,12 @@ TOO_MANY_NEW_URLS, DOWNLOAD_ERROR, IMPORT_ERROR, + // Got a failure result from GetOperation (or the GeneratePageBundle + // metadata). + ARCHIVING_FAILED, + // Got a failure result from GetOperation or GeneratePageBundle that a + // server-side limit on the page was exceeded. + ARCHIVING_LIMIT_EXCEEDED, }; // Callback invoked upon completion of a prefetch request.
diff --git a/components/offline_pages/core/prefetch/store/prefetch_store_unittest.cc b/components/offline_pages/core/prefetch/store/prefetch_store_unittest.cc index 8ae4573..3212dc9 100644 --- a/components/offline_pages/core/prefetch/store/prefetch_store_unittest.cc +++ b/components/offline_pages/core/prefetch/store/prefetch_store_unittest.cc
@@ -55,7 +55,7 @@ TEST_F(PrefetchStoreTest, WriteAndLoadOneItem) { // Create an item populated with unique, non-default values. PrefetchItem item1( - item_generator()->CreateItem(PrefetchItemState::AWAITING_GCM)); + item_generator()->CreateItem(PrefetchItemState::DOWNLOADED)); item1.generate_bundle_attempts = 10; item1.get_operation_attempts = 11; item1.download_initiation_attempts = 12;
diff --git a/components/offline_pages/core/prefetch/test_prefetch_dispatcher.cc b/components/offline_pages/core/prefetch/test_prefetch_dispatcher.cc index 1fd8418..0801c1875 100644 --- a/components/offline_pages/core/prefetch/test_prefetch_dispatcher.cc +++ b/components/offline_pages/core/prefetch/test_prefetch_dispatcher.cc
@@ -39,7 +39,9 @@ void TestPrefetchDispatcher::SetService(PrefetchService* service) {} -void TestPrefetchDispatcher::SchedulePipelineProcessing() {} +void TestPrefetchDispatcher::SchedulePipelineProcessing() { + processing_schedule_count++; +} void TestPrefetchDispatcher::GCMOperationCompletedMessageReceived( const std::string& operation_name) {
diff --git a/components/offline_pages/core/prefetch/test_prefetch_dispatcher.h b/components/offline_pages/core/prefetch/test_prefetch_dispatcher.h index 86bb1ded..bb3ebb75 100644 --- a/components/offline_pages/core/prefetch/test_prefetch_dispatcher.h +++ b/components/offline_pages/core/prefetch/test_prefetch_dispatcher.h
@@ -43,6 +43,7 @@ std::vector<std::string> operation_list; int new_suggestions_count = 0; + int processing_schedule_count = 0; int remove_all_suggestions_count = 0; int remove_by_client_id_count = 0; };
diff --git a/components/security_interstitials/core/BUILD.gn b/components/security_interstitials/core/BUILD.gn index ec859cf..f1a6a910 100644 --- a/components/security_interstitials/core/BUILD.gn +++ b/components/security_interstitials/core/BUILD.gn
@@ -14,6 +14,8 @@ "controller_client.h", "metrics_helper.cc", "metrics_helper.h", + "mitm_software_ui.cc", + "mitm_software_ui.h", "safe_browsing_loud_error_ui.cc", "safe_browsing_loud_error_ui.h", "safe_browsing_quiet_error_ui.cc", @@ -26,6 +28,13 @@ "urls.h", ] + if (is_ios) { + sources -= [ + "mitm_software_ui.cc", + "mitm_software_ui.h", + ] + } + deps = [ "//base", "//base:i18n",
diff --git a/components/security_interstitials/core/mitm_software_ui.cc b/components/security_interstitials/core/mitm_software_ui.cc new file mode 100644 index 0000000..ccde34fa --- /dev/null +++ b/components/security_interstitials/core/mitm_software_ui.cc
@@ -0,0 +1,89 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/security_interstitials/core/mitm_software_ui.h" + +#include "base/i18n/time_formatting.h" +#include "components/security_interstitials/core/common_string_util.h" +#include "components/security_interstitials/core/metrics_helper.h" +#include "components/ssl_errors/error_info.h" +#include "components/strings/grit/components_strings.h" +#include "ui/base/l10n/l10n_util.h" + +namespace security_interstitials { + +MITMSoftwareUI::MITMSoftwareUI(const GURL& request_url, + int cert_error, + const net::SSLInfo& ssl_info, + ControllerClient* controller) + : request_url_(request_url), + cert_error_(cert_error), + ssl_info_(ssl_info), + controller_(controller) { + controller_->metrics_helper()->RecordUserInteraction( + security_interstitials::MetricsHelper::TOTAL_VISITS); +} + +MITMSoftwareUI::~MITMSoftwareUI() { + controller_->metrics_helper()->RecordShutdownMetrics(); +} + +// TODO(sperigo): Fill in placeholder strings. +void MITMSoftwareUI::PopulateStringsForHTML( + base::DictionaryValue* load_time_data) { + CHECK(load_time_data); + + // Shared with other SSL errors. + common_string_util::PopulateSSLLayoutStrings(cert_error_, load_time_data); + common_string_util::PopulateSSLDebuggingStrings( + ssl_info_, base::Time::NowFromSystemTime(), load_time_data); + + load_time_data->SetString("tabTitle", std::string()); + load_time_data->SetString("heading", std::string()); + load_time_data->SetString("primaryParagraph", std::string()); + load_time_data->SetBoolean("overridable", false); + load_time_data->SetBoolean("hide_primary_button", true); + load_time_data->SetBoolean("bad_clock", false); + load_time_data->SetString("explanationParagraph", std::string()); + load_time_data->SetString("primaryButtonText", std::string()); + load_time_data->SetString("finalParagraph", std::string()); +} + +void MITMSoftwareUI::HandleCommand(SecurityInterstitialCommands command) { + switch (command) { + case CMD_DO_REPORT: + controller_->SetReportingPreference(true); + break; + case CMD_DONT_REPORT: + controller_->SetReportingPreference(false); + break; + case CMD_SHOW_MORE_SECTION: + controller_->metrics_helper()->RecordUserInteraction( + security_interstitials::MetricsHelper::SHOW_ADVANCED); + break; + case CMD_OPEN_REPORTING_PRIVACY: + controller_->OpenExtendedReportingPrivacyPolicy(true); + break; + case CMD_OPEN_WHITEPAPER: + controller_->OpenExtendedReportingWhitepaper(true); + break; + case CMD_DONT_PROCEED: + case CMD_OPEN_HELP_CENTER: + case CMD_RELOAD: + case CMD_PROCEED: + case CMD_OPEN_DATE_SETTINGS: + case CMD_OPEN_DIAGNOSTIC: + case CMD_OPEN_LOGIN: + case CMD_REPORT_PHISHING_ERROR: + // Not supported by the SSL error page. + NOTREACHED() << "Unsupported command: " << command; + case CMD_ERROR: + case CMD_TEXT_FOUND: + case CMD_TEXT_NOT_FOUND: + // Commands are for testing. + break; + } +} + +} // namespace security_interstitials
diff --git a/components/security_interstitials/core/mitm_software_ui.h b/components/security_interstitials/core/mitm_software_ui.h new file mode 100644 index 0000000..955b087 --- /dev/null +++ b/components/security_interstitials/core/mitm_software_ui.h
@@ -0,0 +1,40 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_SECURITY_INTERSTITIALS_CORE_MITM_SOFTWARE_UI_H_ +#define COMPONENTS_SECURITY_INTERSTITIALS_CORE_MITM_SOFTWARE_UI_H_ + +#include "base/macros.h" +#include "base/values.h" +#include "components/security_interstitials/core/controller_client.h" +#include "components/ssl_errors/error_classification.h" +#include "net/ssl/ssl_info.h" +#include "url/gurl.h" + +namespace security_interstitials { + +// Provides UI for SSL errors caused by MITM software misconfigurations. +class MITMSoftwareUI { + public: + MITMSoftwareUI(const GURL& request_url, + int cert_error, + const net::SSLInfo& ssl_info, + ControllerClient* controller_); + ~MITMSoftwareUI(); + + void PopulateStringsForHTML(base::DictionaryValue* load_time_data); + void HandleCommand(SecurityInterstitialCommands command); + + private: + const GURL request_url_; + const int cert_error_; + const net::SSLInfo ssl_info_; + ControllerClient* controller_; + + DISALLOW_COPY_AND_ASSIGN(MITMSoftwareUI); +}; + +} // namespace security_interstitials + +#endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_MITM_SOFTWARE_UI_H_
diff --git a/components/viz/common/switches.cc b/components/viz/common/switches.cc index fba7434b7..ee13e20 100644 --- a/components/viz/common/switches.cc +++ b/components/viz/common/switches.cc
@@ -6,15 +6,13 @@ namespace switches { +// Disable surface lifetime management using surface references. This enables +// adding surface sequences and disables adding temporary references. +const char kDisableSurfaceReferences[] = "disable-surface-references"; + // Enables multi-client Surface synchronization. In practice, this indicates // that LayerTreeHost expects to be given a valid viz::LocalSurfaceId provided // by the parent compositor. const char kEnableSurfaceSynchronization[] = "enable-surface-synchronization"; -// Enables surface lifetime management using surface references. This disables -// adding surface sequences and instead adds temporary references. Surface -// lifetime is then based on temporary references and the surface reference -// graph. -const char kEnableSurfaceReferences[] = "enable-surface-references"; - } // namespace switches
diff --git a/components/viz/common/switches.h b/components/viz/common/switches.h index eccb3d2c..69bd307 100644 --- a/components/viz/common/switches.h +++ b/components/viz/common/switches.h
@@ -10,8 +10,8 @@ namespace switches { // Keep list in alphabetical order. +VIZ_COMMON_EXPORT extern const char kDisableSurfaceReferences[]; VIZ_COMMON_EXPORT extern const char kEnableSurfaceSynchronization[]; -VIZ_COMMON_EXPORT extern const char kEnableSurfaceReferences[]; } // namespace switches
diff --git a/components/viz/service/display/display_unittest.cc b/components/viz/service/display/display_unittest.cc index 8a4c825..863831fc 100644 --- a/components/viz/service/display/display_unittest.cc +++ b/components/viz/service/display/display_unittest.cc
@@ -90,12 +90,13 @@ class DisplayTest : public testing::Test { public: DisplayTest() - : support_(CompositorFrameSinkSupport::Create( - nullptr, - &manager_, - kArbitraryFrameSinkId, - true /* is_root */, - true /* needs_sync_points */)), + : manager_(nullptr, SurfaceManager::LifetimeType::REFERENCES), + support_( + CompositorFrameSinkSupport::Create(nullptr, + &manager_, + kArbitraryFrameSinkId, + true /* is_root */, + true /* needs_sync_points */)), task_runner_(new base::NullTaskRunner) {} ~DisplayTest() override { support_->EvictCurrentSurface(); }
diff --git a/components/viz/service/display/surface_aggregator_perftest.cc b/components/viz/service/display/surface_aggregator_perftest.cc index c4cc3846..c0e87fb 100644 --- a/components/viz/service/display/surface_aggregator_perftest.cc +++ b/components/viz/service/display/surface_aggregator_perftest.cc
@@ -30,7 +30,8 @@ class SurfaceAggregatorPerfTest : public testing::Test { public: - SurfaceAggregatorPerfTest() { + SurfaceAggregatorPerfTest() + : manager_(nullptr, SurfaceManager::LifetimeType::REFERENCES) { context_provider_ = cc::TestContextProvider::Create(); context_provider_->BindToCurrentThread(); shared_bitmap_manager_ = base::MakeUnique<cc::TestSharedBitmapManager>();
diff --git a/components/viz/service/display/surface_aggregator_pixeltest.cc b/components/viz/service/display/surface_aggregator_pixeltest.cc index ebaa6ab6..5b73c3ee 100644 --- a/components/viz/service/display/surface_aggregator_pixeltest.cc +++ b/components/viz/service/display/surface_aggregator_pixeltest.cc
@@ -34,12 +34,12 @@ class SurfaceAggregatorPixelTest : public cc::RendererPixelTest<GLRenderer> { public: SurfaceAggregatorPixelTest() - : support_( - CompositorFrameSinkSupport::Create(nullptr, - &manager_, - kArbitraryRootFrameSinkId, - kIsRoot, - kNeedsSyncPoints)) {} + : manager_(nullptr, SurfaceManager::LifetimeType::REFERENCES), + support_(CompositorFrameSinkSupport::Create(nullptr, + &manager_, + kArbitraryRootFrameSinkId, + kIsRoot, + kNeedsSyncPoints)) {} ~SurfaceAggregatorPixelTest() override { support_->EvictCurrentSurface(); } protected:
diff --git a/components/viz/service/display/surface_aggregator_unittest.cc b/components/viz/service/display/surface_aggregator_unittest.cc index a950fc9..ff20e42 100644 --- a/components/viz/service/display/surface_aggregator_unittest.cc +++ b/components/viz/service/display/surface_aggregator_unittest.cc
@@ -63,13 +63,13 @@ class SurfaceAggregatorTest : public testing::Test { public: explicit SurfaceAggregatorTest(bool use_damage_rect) - : observer_(false), - support_( - CompositorFrameSinkSupport::Create(&fake_client_, - &manager_, - kArbitraryRootFrameSinkId, - kRootIsRoot, - kNeedsSyncPoints)), + : manager_(nullptr, SurfaceManager::LifetimeType::REFERENCES), + observer_(false), + support_(CompositorFrameSinkSupport::Create(&fake_client_, + &manager_, + kArbitraryRootFrameSinkId, + kRootIsRoot, + kNeedsSyncPoints)), aggregator_(manager_.surface_manager(), NULL, use_damage_rect) { manager_.surface_manager()->AddObserver(&observer_); } @@ -2127,6 +2127,9 @@ class SurfaceAggregatorWithResourcesTest : public testing::Test { public: + SurfaceAggregatorWithResourcesTest() + : manager_(nullptr, SurfaceManager::LifetimeType::REFERENCES) {} + void SetUp() override { shared_bitmap_manager_ = base::MakeUnique<cc::TestSharedBitmapManager>(); resource_provider_ =
diff --git a/components/viz/service/frame_sinks/compositor_frame_sink_support_unittest.cc b/components/viz/service/frame_sinks/compositor_frame_sink_support_unittest.cc index 77d93da2..1c68332 100644 --- a/components/viz/service/frame_sinks/compositor_frame_sink_support_unittest.cc +++ b/components/viz/service/frame_sinks/compositor_frame_sink_support_unittest.cc
@@ -19,6 +19,7 @@ #include "components/viz/test/fake_external_begin_frame_source.h" #include "components/viz/test/fake_surface_observer.h" #include "components/viz/test/mock_compositor_frame_sink_support_client.h" +#include "services/viz/compositing/privileged/interfaces/frame_sink_manager.mojom.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -32,13 +33,11 @@ namespace viz { namespace { -constexpr bool kIsRoot = true; -constexpr bool kIsChildRoot = false; +constexpr bool kIsRoot = false; constexpr bool kNeedsSyncPoints = true; constexpr FrameSinkId kArbitraryFrameSinkId(1, 1); constexpr FrameSinkId kAnotherArbitraryFrameSinkId(2, 2); -constexpr FrameSinkId kYetAnotherArbitraryFrameSinkId(3, 3); const base::UnguessableToken kArbitraryToken = base::UnguessableToken::Create(); const base::UnguessableToken kArbitrarySourceId1 = @@ -53,6 +52,50 @@ return token; } +// A test mojom::FrameSinkManagerClient that by default drops temporary +// references unless SetTemporaryReferenceToAssign() is used. +class FakeFrameSinkManagerClient : public mojom::FrameSinkManagerClient { + public: + explicit FakeFrameSinkManagerClient(mojom::FrameSinkManager* manager) + : manager_(manager) {} + ~FakeFrameSinkManagerClient() override = default; + + // Sets owner for |surface_id| when OnFirstSurfaceActivation() is called. If + // not set the temporary reference will be dropped. + void SetTemporaryReferenceToAssign(const SurfaceId& surface_id, + const FrameSinkId& frame_sink_id) { + temporary_references_to_assign_[surface_id] = frame_sink_id; + } + + // mojom::FrameSinkManagerClient: + void OnFirstSurfaceActivation(const SurfaceInfo& surface_info) override { + auto iter = temporary_references_to_assign_.find(surface_info.id()); + if (iter == temporary_references_to_assign_.end()) { + manager_->DropTemporaryReference(surface_info.id()); + return; + } + + manager_->AssignTemporaryReference(surface_info.id(), iter->second); + temporary_references_to_assign_.erase(iter); + } + void OnClientConnectionClosed(const FrameSinkId& frame_sink_id) override {} + void OnAggregatedHitTestRegionListUpdated( + const FrameSinkId& frame_sink_id, + mojo::ScopedSharedBufferHandle active_handle, + uint32_t active_handle_size, + mojo::ScopedSharedBufferHandle idle_handle, + uint32_t idle_handle_sizes) override {} + void SwitchActiveAggregatedHitTestRegionList( + const FrameSinkId& frame_sink_id, + uint8_t active_handle_index) override {} + + private: + mojom::FrameSinkManager* const manager_; + base::flat_map<SurfaceId, FrameSinkId> temporary_references_to_assign_; + + DISALLOW_COPY_AND_ASSIGN(FakeFrameSinkManagerClient); +}; + class FakeCompositorFrameSinkSupportClient : public CompositorFrameSinkSupportClient { public: @@ -95,10 +138,13 @@ class CompositorFrameSinkSupportTest : public testing::Test { public: CompositorFrameSinkSupportTest() - : begin_frame_source_(0.f, false), + : manager_(nullptr, SurfaceManager::LifetimeType::REFERENCES), + frame_sink_manager_client_(&manager_), + begin_frame_source_(0.f, false), local_surface_id_(3, kArbitraryToken), frame_sync_token_(GenTestSyncToken(4)), consumer_sync_token_(GenTestSyncToken(5)) { + manager_.SetLocalClient(&frame_sink_manager_client_); manager_.surface_manager()->AddObserver(&surface_observer_); manager_.RegisterFrameSinkId(kArbitraryFrameSinkId); support_ = CompositorFrameSinkSupport::Create( @@ -169,6 +215,7 @@ protected: FrameSinkManagerImpl manager_; + FakeFrameSinkManagerClient frame_sink_manager_client_; FakeCompositorFrameSinkSupportClient fake_support_client_; std::unique_ptr<CompositorFrameSinkSupport> support_; FakeExternalBeginFrameSource begin_frame_source_; @@ -533,194 +580,31 @@ manager_.InvalidateFrameSinkId(kAnotherArbitraryFrameSinkId); } -// Tests doing an EvictCurrentSurface which has unregistered dependency. -TEST_F(CompositorFrameSinkSupportTest, - EvictCurrentSurfaceDependencyUnRegistered) { - manager_.RegisterFrameSinkId(kAnotherArbitraryFrameSinkId); - test::MockCompositorFrameSinkSupportClient mock_client; - auto support = CompositorFrameSinkSupport::Create( - &mock_client, &manager_, kAnotherArbitraryFrameSinkId, kIsRoot, - kNeedsSyncPoints); - LocalSurfaceId local_surface_id(7, kArbitraryToken); +// Verify that a temporary reference blocks surface eviction and that when the +// temporary reference is removed due to frame sink invalidation the surface +// is deleted. +TEST_F(CompositorFrameSinkSupportTest, EvictSurfaceWithTemporaryReference) { + constexpr FrameSinkId parent_frame_sink_id(1234, 5678); + manager_.RegisterFrameSinkId(parent_frame_sink_id); - TransferableResource resource; - resource.id = 1; - resource.mailbox_holder.texture_target = GL_TEXTURE_2D; - auto frame = test::MakeCompositorFrame(); - frame.resource_list.push_back(resource); - support->SubmitCompositorFrame(local_surface_id, std::move(frame)); - EXPECT_EQ(surface_observer_.last_created_surface_id().local_surface_id(), - local_surface_id); - local_surface_id_ = LocalSurfaceId(); + const LocalSurfaceId local_surface_id(5, kArbitraryToken); + const SurfaceId surface_id(support_->frame_sink_id(), local_surface_id); - SurfaceId surface_id(kAnotherArbitraryFrameSinkId, local_surface_id); - Surface* surface = GetSurfaceForId(surface_id); - surface->AddDestructionDependency( - SurfaceSequence(kYetAnotherArbitraryFrameSinkId, 4)); - - std::vector<ReturnedResource> returned_resource = { - resource.ToReturnedResource()}; - - EXPECT_TRUE(GetSurfaceForId(surface_id)); - EXPECT_CALL(mock_client, DidReceiveCompositorFrameAck(returned_resource)) - .Times(1); - support->EvictCurrentSurface(); - EXPECT_FALSE(GetSurfaceForId(surface_id)); - manager_.InvalidateFrameSinkId(kAnotherArbitraryFrameSinkId); -} - -// Tests doing an EvictCurrentSurface which has registered dependency. -TEST_F(CompositorFrameSinkSupportTest, - EvictCurrentSurfaceDependencyRegistered) { - manager_.RegisterFrameSinkId(kAnotherArbitraryFrameSinkId); - test::MockCompositorFrameSinkSupportClient mock_client; - auto support = CompositorFrameSinkSupport::Create( - &mock_client, &manager_, kAnotherArbitraryFrameSinkId, kIsRoot, - kNeedsSyncPoints); - LocalSurfaceId local_surface_id(7, kArbitraryToken); - - TransferableResource resource; - resource.id = 1; - resource.mailbox_holder.texture_target = GL_TEXTURE_2D; - auto frame = test::MakeCompositorFrame(); - frame.resource_list.push_back(resource); - uint32_t execute_count = 0; - support->SubmitCompositorFrame(local_surface_id, std::move(frame)); - EXPECT_EQ(surface_observer_.last_created_surface_id().local_surface_id(), - local_surface_id); - local_surface_id_ = LocalSurfaceId(); - - manager_.surface_manager()->RegisterFrameSinkId( - kYetAnotherArbitraryFrameSinkId); - - SurfaceId surface_id(kAnotherArbitraryFrameSinkId, local_surface_id); - Surface* surface = GetSurfaceForId(surface_id); - surface->AddDestructionDependency( - SurfaceSequence(kYetAnotherArbitraryFrameSinkId, 4)); - - std::vector<ReturnedResource> returned_resources; - EXPECT_TRUE(GetSurfaceForId(surface_id)); - support->EvictCurrentSurface(); - EXPECT_TRUE(GetSurfaceForId(surface_id)); - EXPECT_EQ(0u, execute_count); - - returned_resources.push_back(resource.ToReturnedResource()); - EXPECT_CALL(mock_client, DidReceiveCompositorFrameAck(returned_resources)) - .Times(1); - manager_.surface_manager()->SatisfySequence( - SurfaceSequence(kYetAnotherArbitraryFrameSinkId, 4)); - EXPECT_FALSE(GetSurfaceForId(surface_id)); - manager_.InvalidateFrameSinkId(kAnotherArbitraryFrameSinkId); -} - -TEST_F(CompositorFrameSinkSupportTest, DestroySequence) { - manager_.RegisterFrameSinkId(kYetAnotherArbitraryFrameSinkId); - LocalSurfaceId local_surface_id2(5, kArbitraryToken); - auto support2 = CompositorFrameSinkSupport::Create( - &fake_support_client_, &manager_, kYetAnotherArbitraryFrameSinkId, - kIsChildRoot, kNeedsSyncPoints); - SurfaceId id2(kYetAnotherArbitraryFrameSinkId, local_surface_id2); - support2->SubmitCompositorFrame(local_surface_id2, - test::MakeCompositorFrame()); - - // Check that waiting before the sequence is satisfied works. - GetSurfaceForId(id2)->AddDestructionDependency( - SurfaceSequence(kYetAnotherArbitraryFrameSinkId, 4)); - support2->EvictCurrentSurface(); - - DCHECK(GetSurfaceForId(id2)); - manager_.surface_manager()->SatisfySequence( - SurfaceSequence(kYetAnotherArbitraryFrameSinkId, 4)); - manager_.surface_manager()->SatisfySequence( - SurfaceSequence(kYetAnotherArbitraryFrameSinkId, 6)); - DCHECK(!GetSurfaceForId(id2)); - - // Check that waiting after the sequence is satisfied works. - support2->SubmitCompositorFrame(local_surface_id2, - test::MakeCompositorFrame()); - DCHECK(GetSurfaceForId(id2)); - GetSurfaceForId(id2)->AddDestructionDependency( - SurfaceSequence(kAnotherArbitraryFrameSinkId, 6)); - support2->EvictCurrentSurface(); - DCHECK(!GetSurfaceForId(id2)); - manager_.InvalidateFrameSinkId(kYetAnotherArbitraryFrameSinkId); -} - -// Tests that SurfaceId namespace invalidation correctly allows -// Sequences to be ignored. -TEST_F(CompositorFrameSinkSupportTest, InvalidFrameSinkId) { - FrameSinkId frame_sink_id(1234, 5678); - - LocalSurfaceId local_surface_id(5, kArbitraryToken); - SurfaceId id(support_->frame_sink_id(), local_surface_id); + // When CompositorFrame is submitted, a temporary refrence will be created and + // |parent_frame_sink_id| will be assigned as the owner. + frame_sink_manager_client_.SetTemporaryReferenceToAssign( + surface_id, parent_frame_sink_id); support_->SubmitCompositorFrame(local_surface_id, test::MakeCompositorFrame()); - manager_.surface_manager()->RegisterFrameSinkId(frame_sink_id); - GetSurfaceForId(id)->AddDestructionDependency( - SurfaceSequence(frame_sink_id, 4)); - + // Verify the temporary reference has prevented the surface from getting + // destroyed. support_->EvictCurrentSurface(); + EXPECT_TRUE(GetSurfaceForId(surface_id)); - // Verify the dependency has prevented the surface from getting destroyed. - EXPECT_TRUE(GetSurfaceForId(id)); - - manager_.InvalidateFrameSinkId(frame_sink_id); - - // Verify that the invalidated namespace caused the unsatisfied sequence - // to be ignored. - EXPECT_FALSE(GetSurfaceForId(id)); -} - -TEST_F(CompositorFrameSinkSupportTest, DestroyCycle) { - manager_.RegisterFrameSinkId(kAnotherArbitraryFrameSinkId); - LocalSurfaceId local_surface_id2(5, kArbitraryToken); - SurfaceId id2(kYetAnotherArbitraryFrameSinkId, local_surface_id2); - auto support2 = CompositorFrameSinkSupport::Create( - &fake_support_client_, &manager_, kYetAnotherArbitraryFrameSinkId, - kIsChildRoot, kNeedsSyncPoints); - // Give local_surface_id_ an initial frame so another client can refer to - // that surface. - { - auto frame = test::MakeCompositorFrame(); - support_->SubmitCompositorFrame(local_surface_id_, std::move(frame)); - } - // Give id2 a frame that references local_surface_id_. - { - auto frame = test::MakeCompositorFrame(); - frame.metadata.referenced_surfaces.push_back( - SurfaceId(support_->frame_sink_id(), local_surface_id_)); - support2->SubmitCompositorFrame(local_surface_id2, std::move(frame)); - EXPECT_EQ(surface_observer_.last_created_surface_id().local_surface_id(), - local_surface_id2); - } - GetSurfaceForId(id2)->AddDestructionDependency( - SurfaceSequence(kAnotherArbitraryFrameSinkId, 4)); - support2->EvictCurrentSurface(); - // Give local_surface_id_ a frame that references id2. - { - auto frame = test::MakeCompositorFrame(); - frame.metadata.referenced_surfaces.push_back(id2); - support_->SubmitCompositorFrame(local_surface_id_, std::move(frame)); - } - support_->EvictCurrentSurface(); - EXPECT_TRUE(GetSurfaceForId(id2)); - // local_surface_id_ should be retained by reference from id2. - EXPECT_TRUE( - GetSurfaceForId(SurfaceId(support_->frame_sink_id(), local_surface_id_))); - - // Satisfy last destruction dependency for id2. - manager_.surface_manager()->SatisfySequence( - SurfaceSequence(kAnotherArbitraryFrameSinkId, 4)); - - // id2 and local_surface_id_ are in a reference cycle that has no surface - // sequences holding on to it, so they should be destroyed. - EXPECT_TRUE(!GetSurfaceForId(id2)); - EXPECT_TRUE(!GetSurfaceForId( - SurfaceId(support_->frame_sink_id(), local_surface_id_))); - - local_surface_id_ = LocalSurfaceId(); - manager_.InvalidateFrameSinkId(kAnotherArbitraryFrameSinkId); + // Verify the temporary reference is removed when the parent is invalidated. + manager_.InvalidateFrameSinkId(parent_frame_sink_id); + EXPECT_FALSE(GetSurfaceForId(surface_id)); } void CopyRequestTestCallback(bool* called,
diff --git a/components/viz/service/frame_sinks/direct_layer_tree_frame_sink_unittest.cc b/components/viz/service/frame_sinks/direct_layer_tree_frame_sink_unittest.cc index ac33034..99bc5158 100644 --- a/components/viz/service/frame_sinks/direct_layer_tree_frame_sink_unittest.cc +++ b/components/viz/service/frame_sinks/direct_layer_tree_frame_sink_unittest.cc
@@ -69,6 +69,7 @@ task_runner_(new cc::OrderedSimpleTaskRunner(now_src_.get(), true)), display_size_(1920, 1080), display_rect_(display_size_), + frame_sink_manager_(nullptr, SurfaceManager::LifetimeType::REFERENCES), support_manager_(&frame_sink_manager_), context_provider_(cc::TestContextProvider::Create()) { auto display_output_surface = cc::FakeOutputSurface::Create3d();
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc b/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc index 1aac76af..82d25aee 100644 --- a/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc +++ b/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc
@@ -64,7 +64,8 @@ class FrameSinkManagerTest : public testing::Test { public: - FrameSinkManagerTest() = default; + FrameSinkManagerTest() + : manager_(nullptr, SurfaceManager::LifetimeType::REFERENCES) {} ~FrameSinkManagerTest() override = default;
diff --git a/content/app/strings/content_strings.grd b/content/app/strings/content_strings.grd index ea3c1d883..ac8876bb 100644 --- a/content/app/strings/content_strings.grd +++ b/content/app/strings/content_strings.grd
@@ -341,9 +341,6 @@ <message name="IDS_AX_ROLE_BLOCKQUOTE" desc="Accessibility role description for a blockquote"> blockquote </message> - <message name="IDS_AX_ROLE_BUSY_INDICATOR" desc="Accessibility role description for a busy indicator"> - busy indicator - </message> <message name="IDS_AX_ROLE_BUTTON" desc="Accessibility role description for a button"> button </message> @@ -416,9 +413,6 @@ <message name="IDS_AX_ROLE_NOTE" desc="Accessibility role description for a note"> note </message> - <message name="IDS_AX_ROLE_OUTLINE" desc="Accessibility role description for an outline, a presentation of information in a tree-like structure"> - outline - </message> <message name="IDS_AX_ROLE_POP_UP_BUTTON" desc="Accessibility role description for a pop up button"> pop up button </message> @@ -434,9 +428,6 @@ <message name="IDS_AX_ROLE_ROW_HEADER" desc="Accessibility role description for a row header in a table"> row header </message> - <message name="IDS_AX_ROLE_RULER" desc="Accessibility role description for a ruler"> - ruler - </message> <message name="IDS_AX_ROLE_SCROLL_BAR" desc="Accessibility role description for a scroll bar"> scroll bar </message>
diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc index e59d532c..f2dfef4 100644 --- a/content/browser/accessibility/browser_accessibility_android.cc +++ b/content/browser/accessibility/browser_accessibility_android.cc
@@ -290,8 +290,7 @@ } bool BrowserAccessibilityAndroid::IsScrollable() const { - return (HasIntAttribute(ui::AX_ATTR_SCROLL_X_MAX) && - GetRole() != ui::AX_ROLE_SCROLL_AREA); + return HasIntAttribute(ui::AX_ATTR_SCROLL_X_MAX); } bool BrowserAccessibilityAndroid::IsSelected() const { @@ -480,9 +479,6 @@ case ui::AX_ROLE_BLOCKQUOTE: message_id = IDS_AX_ROLE_BLOCKQUOTE; break; - case ui::AX_ROLE_BUSY_INDICATOR: - message_id = IDS_AX_ROLE_BUSY_INDICATOR; - break; case ui::AX_ROLE_BUTTON: message_id = IDS_AX_ROLE_BUTTON; break; @@ -602,9 +598,6 @@ case ui::AX_ROLE_IGNORED: // No role description. break; - case ui::AX_ROLE_IMAGE_MAP_LINK: - message_id = IDS_AX_ROLE_LINK; - break; case ui::AX_ROLE_IMAGE_MAP: message_id = IDS_AX_ROLE_GRAPHIC; break; @@ -695,9 +688,6 @@ case ui::AX_ROLE_NOTE: message_id = IDS_AX_ROLE_NOTE; break; - case ui::AX_ROLE_OUTLINE: - message_id = IDS_AX_ROLE_OUTLINE; - break; case ui::AX_ROLE_PANE: // No role description. break; @@ -737,21 +727,12 @@ case ui::AX_ROLE_RUBY: // No role description. break; - case ui::AX_ROLE_RULER: - message_id = IDS_AX_ROLE_RULER; - break; case ui::AX_ROLE_SVG_ROOT: message_id = IDS_AX_ROLE_GRAPHIC; break; - case ui::AX_ROLE_SCROLL_AREA: - // No role description. - break; case ui::AX_ROLE_SCROLL_BAR: message_id = IDS_AX_ROLE_SCROLL_BAR; break; - case ui::AX_ROLE_SEAMLESS_WEB_AREA: - // No role description. - break; case ui::AX_ROLE_SEARCH: message_id = IDS_AX_ROLE_SEARCH; break; @@ -782,9 +763,6 @@ case ui::AX_ROLE_SWITCH: message_id = IDS_AX_ROLE_SWITCH; break; - case ui::AX_ROLE_TAB_GROUP: - // No role description. - break; case ui::AX_ROLE_TAB_LIST: message_id = IDS_AX_ROLE_TAB_LIST; break;
diff --git a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc index 9ab09698..4fb7c11 100644 --- a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc +++ b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc
@@ -364,11 +364,7 @@ GetAttr(iframe, ui::AX_ATTR_HTML_TAG).c_str()); ASSERT_EQ(1, iframe->child_count()); - const ui::AXNode* scroll_area = iframe->ChildAtIndex(0); - EXPECT_EQ(ui::AX_ROLE_SCROLL_AREA, scroll_area->data().role); - ASSERT_EQ(1, scroll_area->child_count()); - - const ui::AXNode* sub_document = scroll_area->ChildAtIndex(0); + const ui::AXNode* sub_document = iframe->ChildAtIndex(0); EXPECT_EQ(ui::AX_ROLE_WEB_AREA, sub_document->data().role); ASSERT_EQ(1, sub_document->child_count());
diff --git a/content/browser/accessibility/one_shot_accessibility_tree_search.cc b/content/browser/accessibility/one_shot_accessibility_tree_search.cc index ff9c44d5..16694f6 100644 --- a/content/browser/accessibility/one_shot_accessibility_tree_search.cc +++ b/content/browser/accessibility/one_shot_accessibility_tree_search.cc
@@ -258,7 +258,6 @@ if (node->HasState(ui::AX_STATE_FOCUSABLE) && node->GetRole() != ui::AX_ROLE_IFRAME && node->GetRole() != ui::AX_ROLE_IFRAME_PRESENTATIONAL && - node->GetRole() != ui::AX_ROLE_IMAGE_MAP_LINK && node->GetRole() != ui::AX_ROLE_LINK && node->GetRole() != ui::AX_ROLE_WEB_AREA && node->GetRole() != ui::AX_ROLE_ROOT_WEB_AREA) { @@ -363,8 +362,7 @@ bool AccessibilityLinkPredicate( BrowserAccessibility* start, BrowserAccessibility* node) { - return (node->GetRole() == ui::AX_ROLE_LINK || - node->GetRole() == ui::AX_ROLE_IMAGE_MAP_LINK); + return node->GetRole() == ui::AX_ROLE_LINK; } bool AccessibilityListPredicate( @@ -443,16 +441,14 @@ bool AccessibilityUnvisitedLinkPredicate( BrowserAccessibility* start, BrowserAccessibility* node) { - return ((node->GetRole() == ui::AX_ROLE_LINK || - node->GetRole() == ui::AX_ROLE_IMAGE_MAP_LINK) && - !node->HasState(ui::AX_STATE_VISITED)); + return node->GetRole() == ui::AX_ROLE_LINK && + !node->HasState(ui::AX_STATE_VISITED); } bool AccessibilityVisitedLinkPredicate( BrowserAccessibility* start, BrowserAccessibility* node) { - return ((node->GetRole() == ui::AX_ROLE_LINK || - node->GetRole() == ui::AX_ROLE_IMAGE_MAP_LINK) && - node->HasState(ui::AX_STATE_VISITED)); + return node->GetRole() == ui::AX_ROLE_LINK && + node->HasState(ui::AX_STATE_VISITED); } } // namespace content
diff --git a/content/browser/android/web_contents_observer_proxy.cc b/content/browser/android/web_contents_observer_proxy.cc index 5af662e..4e584bb 100644 --- a/content/browser/android/web_contents_observer_proxy.cc +++ b/content/browser/android/web_contents_observer_proxy.cc
@@ -158,7 +158,8 @@ } // TODO(shaktisahu): Provide appropriate error description (crbug/690784). - ScopedJavaLocalRef<jstring> jerror_description; + ScopedJavaLocalRef<jstring> jerror_description = + ConvertUTF8ToJavaString(env, ""); Java_WebContentsObserverProxy_didFinishNavigation( env, obj, jstring_url, navigation_handle->IsInMainFrame(),
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index a11f913b..8d00db2 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -1479,9 +1479,9 @@ // See https://crbug.com/676384. auto surface_lifetime_type = base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableSurfaceReferences) - ? viz::SurfaceManager::LifetimeType::REFERENCES - : viz::SurfaceManager::LifetimeType::SEQUENCES; + switches::kDisableSurfaceReferences) + ? viz::SurfaceManager::LifetimeType::SEQUENCES + : viz::SurfaceManager::LifetimeType::REFERENCES; frame_sink_manager_impl_ = base::MakeUnique<viz::FrameSinkManagerImpl>( nullptr /* display_provider */, surface_lifetime_type);
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame_browsertest.cc b/content/browser/frame_host/render_widget_host_view_child_frame_browsertest.cc index 12a0d80..0f9f2118 100644 --- a/content/browser/frame_host/render_widget_host_view_child_frame_browsertest.cc +++ b/content/browser/frame_host/render_widget_host_view_child_frame_browsertest.cc
@@ -182,8 +182,9 @@ // Test that when a child frame submits its first compositor frame, the // embedding renderer process properly acquires and releases references to the // new Surface. See https://crbug.com/701175. +// TODO(crbug.com/676384): Delete test with the rest of SurfaceSequence code. IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewChildFrameTest, - ChildFrameSurfaceReference) { + DISABLED_ChildFrameSurfaceReference) { EXPECT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL( "a.com", "/cross_site_iframe_factory.html?a(a)")));
diff --git a/content/browser/media/OWNERS b/content/browser/media/OWNERS index 760028a..7d171068 100644 --- a/content/browser/media/OWNERS +++ b/content/browser/media/OWNERS
@@ -1,4 +1,6 @@ file://media/OWNERS +olka@chromium.org +maxmorin@chromium.org per-file media_devices_*=guidou@chromium.org per-file midi_*=toyoshim@chromium.org
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index 4a6de58..ca338525 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -44,6 +44,7 @@ #include "components/viz/common/gl_helper.h" #include "components/viz/common/gpu/context_provider.h" #include "components/viz/common/surfaces/frame_sink_id_allocator.h" +#include "components/viz/common/switches.h" #include "components/viz/host/host_frame_sink_manager.h" #include "components/viz/service/display/display.h" #include "components/viz/service/display/display_scheduler.h" @@ -101,9 +102,16 @@ struct CompositorDependencies { CompositorDependencies() : frame_sink_id_allocator(kDefaultClientId) { + auto surface_lifetime_type = + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableSurfaceReferences) + ? viz::SurfaceManager::LifetimeType::SEQUENCES + : viz::SurfaceManager::LifetimeType::REFERENCES; + // TODO(danakj): Don't make a FrameSinkManagerImpl when display is in the // Gpu process, instead get the mojo pointer from the Gpu process. - frame_sink_manager_impl = base::MakeUnique<viz::FrameSinkManagerImpl>(); + frame_sink_manager_impl = base::MakeUnique<viz::FrameSinkManagerImpl>( + nullptr /* display_provider */, surface_lifetime_type); surface_utils::ConnectWithLocalFrameSinkManager( &host_frame_sink_manager, frame_sink_manager_impl.get()); }
diff --git a/content/browser/renderer_host/media/OWNERS b/content/browser/renderer_host/media/OWNERS index 28408907..68a9bdc 100644 --- a/content/browser/renderer_host/media/OWNERS +++ b/content/browser/renderer_host/media/OWNERS
@@ -4,6 +4,8 @@ emircan@chromium.org guidou@chromium.org tommi@chromium.org +olka@chromium.org +maxmorin@chromium.org per-file *video*=mcasas@chromium.org per-file *video*=chfremer@chromium.org
diff --git a/content/browser/renderer_host/media/audio_input_device_manager.cc b/content/browser/renderer_host/media/audio_input_device_manager.cc index 581e2b1..a2f8980 100644 --- a/content/browser/renderer_host/media/audio_input_device_manager.cc +++ b/content/browser/renderer_host/media/audio_input_device_manager.cc
@@ -174,7 +174,10 @@ ? input_params : media::AudioParameters::UnavailableDeviceParams(); info.device.matched_output_device_id = matched_output_device_id; - info.device.matched_output = matched_output_params; + info.device.matched_output = + matched_output_params.IsValid() + ? matched_output_params + : media::AudioParameters::UnavailableDeviceParams(); devices_.push_back(info);
diff --git a/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc b/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc index e0ce863..d6ea130 100644 --- a/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc +++ b/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
@@ -303,7 +303,7 @@ class AudioInputDeviceManagerNoDevicesTest : public MAYBE_AudioInputDeviceManagerTest { public: - AudioInputDeviceManagerNoDevicesTest(){}; + AudioInputDeviceManagerNoDevicesTest() {} protected: void Initialize() override { @@ -341,12 +341,8 @@ // Expects that device parameters stored by the manager are valid. const StreamDeviceInfo* device_info = manager_->GetOpenedDeviceInfoById(session_id); - EXPECT_TRUE( - media::AudioParameters(media::AudioParameters::AUDIO_FAKE, - device_info->device.input.channel_layout(), - device_info->device.input.sample_rate(), 16, - device_info->device.input.frames_per_buffer()) - .IsValid()); + EXPECT_TRUE(device_info->device.input.IsValid()); + EXPECT_TRUE(device_info->device.matched_output.IsValid()); manager_->Close(session_id); EXPECT_CALL(*audio_input_listener_,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 45f97d3..70385ca 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2659,7 +2659,7 @@ cc::switches::kBrowserControlsHideThreshold, cc::switches::kBrowserControlsShowThreshold, cc::switches::kRunAllCompositorStagesBeforeDraw, - switches::kEnableSurfaceReferences, + switches::kDisableSurfaceReferences, switches::kEnableSurfaceSynchronization, #if BUILDFLAG(ENABLE_PLUGINS)
diff --git a/content/browser/resources/media/stats_graph_helper.js b/content/browser/resources/media/stats_graph_helper.js index da65663..25346cd 100644 --- a/content/browser/resources/media/stats_graph_helper.js +++ b/content/browser/resources/media/stats_graph_helper.js
@@ -299,7 +299,7 @@ container.firstChild.firstChild.className = STATS_GRAPH_CONTAINER_HEADING_CLASS; container.firstChild.firstChild.textContent = - 'Stats graphs for ' + report.id; + 'Stats graphs for ' + report.id + ' (' + report.type + ')'; var statsType = getSsrcReportType(report); if (statsType != '') container.firstChild.firstChild.textContent += ' (' + statsType + ')';
diff --git a/content/renderer/accessibility/blink_ax_enum_conversion.cc b/content/renderer/accessibility/blink_ax_enum_conversion.cc index 8b2d3a5..b990bc7 100644 --- a/content/renderer/accessibility/blink_ax_enum_conversion.cc +++ b/content/renderer/accessibility/blink_ax_enum_conversion.cc
@@ -97,8 +97,6 @@ return ui::AX_ROLE_BANNER; case blink::kWebAXRoleBlockquote: return ui::AX_ROLE_BLOCKQUOTE; - case blink::kWebAXRoleBusyIndicator: - return ui::AX_ROLE_BUSY_INDICATOR; case blink::kWebAXRoleButton: return ui::AX_ROLE_BUTTON; case blink::kWebAXRoleCanvas: @@ -173,8 +171,6 @@ return ui::AX_ROLE_IMAGE; case blink::kWebAXRoleImageMap: return ui::AX_ROLE_IMAGE_MAP; - case blink::kWebAXRoleImageMapLink: - return ui::AX_ROLE_IMAGE_MAP_LINK; case blink::kWebAXRoleInlineTextBox: return ui::AX_ROLE_INLINE_TEXT_BOX; case blink::kWebAXRoleInputTime: @@ -229,8 +225,6 @@ return ui::AX_ROLE_NONE; case blink::kWebAXRoleNote: return ui::AX_ROLE_NOTE; - case blink::kWebAXRoleOutline: - return ui::AX_ROLE_OUTLINE; case blink::kWebAXRoleParagraph: return ui::AX_ROLE_PARAGRAPH; case blink::kWebAXRolePopUpButton: @@ -247,24 +241,16 @@ return ui::AX_ROLE_RADIO_GROUP; case blink::kWebAXRoleRegion: return ui::AX_ROLE_REGION; - case blink::kWebAXRoleRootWebArea: - return ui::AX_ROLE_ROOT_WEB_AREA; case blink::kWebAXRoleRow: return ui::AX_ROLE_ROW; case blink::kWebAXRoleRuby: return ui::AX_ROLE_RUBY; case blink::kWebAXRoleRowHeader: return ui::AX_ROLE_ROW_HEADER; - case blink::kWebAXRoleRuler: - return ui::AX_ROLE_RULER; case blink::kWebAXRoleSVGRoot: return ui::AX_ROLE_SVG_ROOT; - case blink::kWebAXRoleScrollArea: - return ui::AX_ROLE_SCROLL_AREA; case blink::kWebAXRoleScrollBar: return ui::AX_ROLE_SCROLL_BAR; - case blink::kWebAXRoleSeamlessWebArea: - return ui::AX_ROLE_SEAMLESS_WEB_AREA; case blink::kWebAXRoleSearch: return ui::AX_ROLE_SEARCH; case blink::kWebAXRoleSearchBox: @@ -287,8 +273,6 @@ return ui::AX_ROLE_SWITCH; case blink::kWebAXRoleTab: return ui::AX_ROLE_TAB; - case blink::kWebAXRoleTabGroup: - return ui::AX_ROLE_TAB_GROUP; case blink::kWebAXRoleTabList: return ui::AX_ROLE_TAB_LIST; case blink::kWebAXRoleTabPanel: @@ -325,13 +309,7 @@ return ui::AX_ROLE_ROOT_WEB_AREA; case blink::kWebAXRoleLineBreak: return ui::AX_ROLE_LINE_BREAK; - case blink::kWebAXRoleWindow: - return ui::AX_ROLE_WINDOW; default: - // We can't add an assertion here, that prevents us - // from adding new role enums in Blink. - LOG(WARNING) << "Warning: Blink WebAXRole " << role - << " not handled by Chromium yet."; return ui::AX_ROLE_UNKNOWN; } }
diff --git a/content/renderer/child_frame_compositing_helper.cc b/content/renderer/child_frame_compositing_helper.cc index 8025493e..f72c341 100644 --- a/content/renderer/child_frame_compositing_helper.cc +++ b/content/renderer/child_frame_compositing_helper.cc
@@ -171,8 +171,8 @@ render_frame_proxy_(render_frame_proxy), frame_(frame) { enable_surface_references_ = - base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableSurfaceReferences); + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableSurfaceReferences); scoped_refptr<ThreadSafeSender> sender( RenderThreadImpl::current()->thread_safe_sender()); if (enable_surface_references_) {
diff --git a/content/renderer/media/OWNERS b/content/renderer/media/OWNERS index bd80b6d0b..f57633a 100644 --- a/content/renderer/media/OWNERS +++ b/content/renderer/media/OWNERS
@@ -8,6 +8,8 @@ perkj@chromium.org tommi@chromium.org guidou@chromium.org +olka@chromium.org +maxmorin@chromium.org per-file *midi*=toyoshim@chromium.org per-file media_stream_audio_processor*=aluebs@chromium.org
diff --git a/content/shell/test_runner/web_ax_object_proxy.cc b/content/shell/test_runner/web_ax_object_proxy.cc index db30448..60c86bd 100644 --- a/content/shell/test_runner/web_ax_object_proxy.cc +++ b/content/shell/test_runner/web_ax_object_proxy.cc
@@ -48,8 +48,6 @@ return result.append("Banner"); case blink::kWebAXRoleBlockquote: return result.append("Blockquote"); - case blink::kWebAXRoleBusyIndicator: - return result.append("BusyIndicator"); case blink::kWebAXRoleButton: return result.append("Button"); case blink::kWebAXRoleCanvas: @@ -114,8 +112,6 @@ return result.append("Heading"); case blink::kWebAXRoleIgnored: return result.append("Ignored"); - case blink::kWebAXRoleImageMapLink: - return result.append("ImageMapLink"); case blink::kWebAXRoleImageMap: return result.append("ImageMap"); case blink::kWebAXRoleImage: @@ -176,8 +172,6 @@ return result.append("None"); case blink::kWebAXRoleNote: return result.append("Note"); - case blink::kWebAXRoleOutline: - return result.append("Outline"); case blink::kWebAXRoleParagraph: return result.append("Paragraph"); case blink::kWebAXRolePopUpButton: @@ -194,24 +188,16 @@ return result.append("RadioGroup"); case blink::kWebAXRoleRegion: return result.append("Region"); - case blink::kWebAXRoleRootWebArea: - return result.append("RootWebArea"); case blink::kWebAXRoleRowHeader: return result.append("RowHeader"); case blink::kWebAXRoleRow: return result.append("Row"); case blink::kWebAXRoleRuby: return result.append("Ruby"); - case blink::kWebAXRoleRuler: - return result.append("Ruler"); case blink::kWebAXRoleSVGRoot: return result.append("SVGRoot"); - case blink::kWebAXRoleScrollArea: - return result.append("ScrollArea"); case blink::kWebAXRoleScrollBar: return result.append("ScrollBar"); - case blink::kWebAXRoleSeamlessWebArea: - return result.append("SeamlessWebArea"); case blink::kWebAXRoleSearch: return result.append("Search"); case blink::kWebAXRoleSearchBox: @@ -232,8 +218,6 @@ return result.append("Status"); case blink::kWebAXRoleSwitch: return result.append("Switch"); - case blink::kWebAXRoleTabGroup: - return result.append("TabGroup"); case blink::kWebAXRoleTabList: return result.append("TabList"); case blink::kWebAXRoleTabPanel: @@ -268,8 +252,6 @@ return result.append("Video"); case blink::kWebAXRoleWebArea: return result.append("WebArea"); - case blink::kWebAXRoleWindow: - return result.append("Window"); default: return result.append("Unknown"); }
diff --git a/content/test/data/payments/payment_app.js b/content/test/data/payments/payment_app.js index 6b30285..eeaf9dd 100644 --- a/content/test/data/payments/payment_app.js +++ b/content/test/data/payments/payment_app.js
@@ -58,7 +58,7 @@ let window_ready = false; let maybeSendPaymentRequest = function() { - if (payment_app_window && window_ready) + if (window_ready) payment_app_window.postMessage('payment_app_request'); }; @@ -83,6 +83,10 @@ e.openWindow(payment_app_web_page) .then(window_client => { payment_app_window = window_client; + if(payment_app_window == null) { + reject('failed to openWindow'); + return; + } maybeSendPaymentRequest(); }) .catch(error => {
diff --git a/extensions/renderer/feature_cache.cc b/extensions/renderer/feature_cache.cc index 11e28d7..6cfef20 100644 --- a/extensions/renderer/feature_cache.cc +++ b/extensions/renderer/feature_cache.cc
@@ -8,9 +8,9 @@ #include "base/command_line.h" #include "content/public/common/content_switches.h" +#include "extensions/common/extension.h" #include "extensions/common/extension_api.h" #include "extensions/common/features/feature_provider.h" -#include "extensions/renderer/script_context.h" namespace extensions { @@ -18,8 +18,18 @@ FeatureCache::~FeatureCache() = default; FeatureCache::FeatureNameVector FeatureCache::GetAvailableFeatures( - ScriptContext* context) { - const FeatureVector& features = GetFeaturesFromCache(context); + Feature::Context context_type, + const Extension* extension, + const GURL& url) { + DCHECK_NE(context_type == Feature::WEBUI_CONTEXT, !!extension) + << "WebUI contexts shouldn't have extensions."; + DCHECK_NE(Feature::WEB_PAGE_CONTEXT, context_type) + << "FeatureCache shouldn't be used for web contexts."; + DCHECK_NE(Feature::UNSPECIFIED_CONTEXT, context_type) + << "FeatureCache shouldn't be used for unspecified contexts."; + + const FeatureVector& features = + GetFeaturesFromCache(context_type, extension, url.GetOrigin()); FeatureNameVector names; names.reserve(features.size()); for (const Feature* feature : features) { @@ -30,8 +40,9 @@ // *may* be available, rather than all known features. // TODO(devlin): Optimize this - we should be able to tell if a feature may // change based on additional context attributes. - if (context->IsAnyFeatureAvailableToContext( - *feature, CheckAliasStatus::NOT_ALLOWED)) { + if (ExtensionAPI::GetSharedInstance()->IsAnyFeatureAvailableToContext( + *feature, extension, context_type, url, + CheckAliasStatus::NOT_ALLOWED)) { names.push_back(feature->name()); } } @@ -39,27 +50,52 @@ } void FeatureCache::InvalidateExtension(const ExtensionId& extension_id) { - for (auto iter = feature_cache_.begin(); iter != feature_cache_.end();) { + for (auto iter = extension_cache_.begin(); iter != extension_cache_.end();) { if (iter->first.first == extension_id) - iter = feature_cache_.erase(iter); + iter = extension_cache_.erase(iter); else ++iter; } } const FeatureCache::FeatureVector& FeatureCache::GetFeaturesFromCache( - ScriptContext* context) { - CacheMapKey key(context->GetExtensionID(), context->context_type()); + Feature::Context context_type, + const Extension* extension, + const GURL& origin) { + if (context_type == Feature::WEBUI_CONTEXT) { + auto iter = webui_cache_.find(origin); + if (iter != webui_cache_.end()) + return iter->second; + return webui_cache_ + .emplace(origin, CreateCacheEntry(context_type, extension, origin)) + .first->second; + } - auto iter = feature_cache_.find(key); - if (iter != feature_cache_.end()) + DCHECK(extension); + ExtensionCacheMapKey key(extension->id(), context_type); + auto iter = extension_cache_.find(key); + if (iter != extension_cache_.end()) return iter->second; + return extension_cache_ + .emplace(key, CreateCacheEntry(context_type, extension, origin)) + .first->second; +} +FeatureCache::FeatureVector FeatureCache::CreateCacheEntry( + Feature::Context context_type, + const Extension* extension, + const GURL& origin) { + bool is_webui = context_type == Feature::WEBUI_CONTEXT; FeatureVector features; const FeatureProvider* api_feature_provider = FeatureProvider::GetAPIFeatures(); GURL empty_url; - const Extension* extension = context->extension(); + // We ignore the URL if this is an extension context in order to maximize + // cache hits. For WebUI, we key on origin. + // Note: Currently, we only ever have matches based on origin, so this is + // okay. If this changes, we'll have to get more creative about our WebUI + // caching. + const GURL& url_to_use = is_webui ? origin : empty_url; for (const auto& map_entry : api_feature_provider->GetAllFeatures()) { const Feature* feature = map_entry.second.get(); // Exclude internal APIs. @@ -81,7 +117,7 @@ } if (!ExtensionAPI::GetSharedInstance()->IsAnyFeatureAvailableToContext( - *feature, extension, context->context_type(), empty_url, + *feature, extension, context_type, url_to_use, CheckAliasStatus::NOT_ALLOWED)) { continue; } @@ -94,7 +130,7 @@ [](const Feature* a, const Feature* b) { return a->name() < b->name(); }); DCHECK(std::unique(features.begin(), features.end()) == features.end()); - return feature_cache_.emplace(key, std::move(features)).first->second; + return features; } } // namespace extensions
diff --git a/extensions/renderer/feature_cache.h b/extensions/renderer/feature_cache.h index e66b42f..13982182 100644 --- a/extensions/renderer/feature_cache.h +++ b/extensions/renderer/feature_cache.h
@@ -13,14 +13,17 @@ #include "base/macros.h" #include "extensions/common/extension_id.h" #include "extensions/common/features/feature.h" +#include "url/gurl.h" namespace extensions { -class ScriptContext; +class Extension; // Caches features available to different extensions in different context types, // and returns features available to a given context. Note: currently, this is // only used for non-webpage contexts. // TODO(devlin): Use it for all context types? +// Note: This could actually go in extensions/common/, if there was any need for +// it browser-side. class FeatureCache { public: using FeatureNameVector = std::vector<std::string>; @@ -28,26 +31,49 @@ FeatureCache(); ~FeatureCache(); - // Returns the names of features available to the given |context| in a - // lexicographically sorted vector. - FeatureNameVector GetAvailableFeatures(ScriptContext* context); + // Returns the names of features available to the given set of |context_type|, + // |extension|, and |url| in a lexicographically sorted vector. + // Note: these contexts should be valid, so WebUI contexts should have no + // extensions, extension should be non-null for extension contexts, etc. + FeatureNameVector GetAvailableFeatures(Feature::Context context_type, + const Extension* extension, + const GURL& url); // Invalidates the cache for the specified extension. void InvalidateExtension(const ExtensionId& extension_id); private: + using FeatureVector = std::vector<const Feature*>; // Note: We use a key of ExtensionId, Feature::Context to maximize cache hits. // Unfortunately, this won't always be perfectly accurate, since some features // may have other context-dependent restrictions (such as URLs), but caching // by extension id + context + url would result in significantly fewer hits. - using FeatureVector = std::vector<const Feature*>; - using CacheMapKey = std::pair<ExtensionId, Feature::Context>; - using CacheMap = std::map<CacheMapKey, FeatureVector>; + using ExtensionCacheMapKey = std::pair<ExtensionId, Feature::Context>; + using ExtensionCacheMap = std::map<ExtensionCacheMapKey, FeatureVector>; - // Returns the features available to the given context from the cache. - const FeatureVector& GetFeaturesFromCache(ScriptContext* context); + // Cache by origin. + using WebUICacheMap = std::map<GURL, FeatureVector>; - CacheMap feature_cache_; + // Returns the features available to the given context from the cache, + // creating a new entry if one doesn't exist. + const FeatureVector& GetFeaturesFromCache(Feature::Context context_type, + const Extension* extension, + const GURL& origin); + + // Creates a FeatureVector to be entered into a cache for the specified + // context data. + FeatureVector CreateCacheEntry(Feature::Context context_type, + const Extension* extension, + const GURL& origin); + + // The cache of extension-related contexts. These may be invalidated, since + // extension permissions change. + ExtensionCacheMap extension_cache_; + + // The cache of WebUI-related features. These shouldn't need to be + // invalidated (since WebUI permissions don't change), and are cached by + // origin. + WebUICacheMap webui_cache_; DISALLOW_COPY_AND_ASSIGN(FeatureCache); };
diff --git a/extensions/renderer/feature_cache_unittest.cc b/extensions/renderer/feature_cache_unittest.cc index a5a3ccc6..c830bc1 100644 --- a/extensions/renderer/feature_cache_unittest.cc +++ b/extensions/renderer/feature_cache_unittest.cc
@@ -50,9 +50,24 @@ .Build(); } +struct FakeContext { + Feature::Context context_type; + const Extension* extension; + const GURL url; +}; + +bool HasFeature(FeatureCache& cache, + const FakeContext& context, + const std::string& feature) { + return base::ContainsValue( + cache.GetAvailableFeatures(context.context_type, context.extension, + context.url), + feature); +} + } // namespace -using FeatureCacheTest = APIBindingTest; +using FeatureCacheTest = testing::Test; TEST_F(FeatureCacheTest, Basic) { FeatureCache cache; @@ -60,29 +75,14 @@ scoped_refptr<const Extension> extension_b = CreateExtension("b", {"storage"}); - v8::HandleScope handle_scope(isolate()); - v8::Local<v8::Context> v8_context_a = MainContext(); - v8::Local<v8::Context> v8_context_b = AddContext(); - - auto script_context_a = base::MakeUnique<ScriptContext>( - v8_context_a, nullptr, extension_a.get(), - Feature::BLESSED_EXTENSION_CONTEXT, extension_a.get(), - Feature::BLESSED_EXTENSION_CONTEXT); - auto script_context_b = base::MakeUnique<ScriptContext>( - v8_context_b, nullptr, extension_b.get(), - Feature::BLESSED_EXTENSION_CONTEXT, extension_b.get(), - Feature::BLESSED_EXTENSION_CONTEXT); - - auto has_feature = [&cache](const std::unique_ptr<ScriptContext>& context, - const std::string& feature) { - return base::ContainsValue(cache.GetAvailableFeatures(context.get()), - feature); - }; - + FakeContext context_a = {Feature::BLESSED_EXTENSION_CONTEXT, + extension_a.get(), extension_a->url()}; + FakeContext context_b = {Feature::BLESSED_EXTENSION_CONTEXT, + extension_b.get(), extension_b->url()}; // To start, context a should not have access to storage, but context b // should. - EXPECT_FALSE(has_feature(script_context_a, "storage")); - EXPECT_TRUE(has_feature(script_context_b, "storage")); + EXPECT_FALSE(HasFeature(cache, context_a, "storage")); + EXPECT_TRUE(HasFeature(cache, context_b, "storage")); // Update extension b's permissions and invalidate the cache. extension_b->permissions_data()->SetPermissions( @@ -90,16 +90,27 @@ cache.InvalidateExtension(extension_b->id()); // Now, neither context should have storage access. - EXPECT_FALSE(has_feature(script_context_a, "storage")); - EXPECT_FALSE(has_feature(script_context_b, "storage")); - - script_context_a->Invalidate(); - script_context_b->Invalidate(); + EXPECT_FALSE(HasFeature(cache, context_a, "storage")); + EXPECT_FALSE(HasFeature(cache, context_b, "storage")); } -// TODO(devlin): It'd be nice to test that the FeatureCache properly handles -// features that are restricted to certain URLs; unfortunately, for that we'd -// need a stubbed out web frame with a given URL, and there's no good way to do -// that outside Blink. +TEST_F(FeatureCacheTest, WebUIContexts) { + FeatureCache cache; + scoped_refptr<const Extension> extension = CreateExtension("a", {}); + + // The chrome://extensions page is whitelisted for the management API. + FakeContext webui_context = {Feature::WEBUI_CONTEXT, nullptr, + GURL("chrome://extensions")}; + // chrome://baz is not whitelisted, and should not have access. + FakeContext webui_context_without_access = {Feature::WEBUI_CONTEXT, nullptr, + GURL("chrome://baz")}; + + EXPECT_TRUE(HasFeature(cache, webui_context, "management")); + EXPECT_FALSE(HasFeature(cache, webui_context_without_access, "management")); + // No webui context is whitelisted for, e.g., the idle API, so neither should + // have access. + EXPECT_FALSE(HasFeature(cache, webui_context, "idle")); + EXPECT_FALSE(HasFeature(cache, webui_context_without_access, "idle")); +} } // namespace extensions
diff --git a/extensions/renderer/native_extension_bindings_system.cc b/extensions/renderer/native_extension_bindings_system.cc index 52d790d2..b05c083 100644 --- a/extensions/renderer/native_extension_bindings_system.cc +++ b/extensions/renderer/native_extension_bindings_system.cc
@@ -508,7 +508,8 @@ } FeatureCache::FeatureNameVector features = - feature_cache_.GetAvailableFeatures(context); + feature_cache_.GetAvailableFeatures(context->context_type(), + context->extension(), context->url()); base::StringPiece last_accessor; for (const std::string& feature : features) { // If we've already set up an accessor for the immediate property of the
diff --git a/ios/build/bots/chromium.fyi/ios-simulator-cronet.json b/ios/build/bots/chromium.fyi/ios-simulator-cronet.json index d2ef4c5..7030ad63 100644 --- a/ios/build/bots/chromium.fyi/ios-simulator-cronet.json +++ b/ios/build/bots/chromium.fyi/ios-simulator-cronet.json
@@ -3,7 +3,7 @@ "Cronet tests for 32- and 64-bit iOS 9.0 simulators.", "Tests run on iPhone 5s (64-bit) and iPad Retina (32-bit)." ], - "xcode version": "8.0", + "xcode version": "9.0", "gn_args": [ "additional_target_cpus=[\"x86\"]", "disable_brotli_filter=false", @@ -19,8 +19,11 @@ "target_os=\"ios\"", "use_platform_icu_alternatives=true" ], + "env": { + "MAC_TOOLCHAIN_REVISION": "9M202q-1" + }, "configuration": "Debug", - "sdk": "iphonesimulator10.0", + "sdk": "iphonesimulator11.0", "tests": [ { "app": "cronet_test", @@ -33,6 +36,19 @@ "device type": "iPad Retina", "os": "9.3", "xcode version": "8.0" + }, + { + "app": "cronet_test", + "device type": "iPhone 5s", + "os": "11.0", + "xcode version": "9.0" + }, + { + "app": "cronet_test", + "device type": "iPad Retina", + "os": "11.0", + "xcode version": "9.0" } + ] }
diff --git a/ios/build/bots/chromium.fyi/ios-simulator.json b/ios/build/bots/chromium.fyi/ios-simulator.json index 65dab5a..9a55be3 100644 --- a/ios/build/bots/chromium.fyi/ios-simulator.json +++ b/ios/build/bots/chromium.fyi/ios-simulator.json
@@ -2,7 +2,7 @@ "comments": [ "Runs tests on @3x, @2x, 64-bit, 32-bit, phone, tablet, iOS 10, and iOS 9." ], - "xcode version": "8.0", + "xcode version": "9.0", "gn_args": [ "additional_target_cpus=[\"x86\"]", "goma_dir=\"$(goma_dir)\"", @@ -12,8 +12,11 @@ "target_os=\"ios\"", "use_goma=true" ], + "env": { + "MAC_TOOLCHAIN_REVISION": "9M202q-1" + }, "configuration": "Debug", - "sdk": "iphonesimulator10.0", + "sdk": "iphonesimulator11.0", "tests": [ { "include": "common_tests.json", @@ -80,6 +83,36 @@ "device type": "iPhone 6s", "os": "10.0", "xcode version": "8.0" + }, + { + "include": "eg_tests.json", + "device type": "iPhone 6s", + "os": "11.0", + "xcode version": "9.0" + }, + { + "include": "common_tests.json", + "device type": "iPhone 6s Plus", + "os": "11.0", + "xcode version": "9.0" + }, + { + "include": "common_tests.json", + "device type": "iPhone 6s", + "os": "11.0", + "xcode version": "9.0" + }, + { + "include": "common_tests.json", + "device type": "iPhone 5", + "os": "11.0", + "xcode version": "9.0" + }, + { + "include": "common_tests.json", + "device type": "iPad Air 2", + "os": "11.0", + "xcode version": "9.0" } ] }
diff --git a/ios/chrome/browser/passwords/resources/password_controller.js b/ios/chrome/browser/passwords/resources/password_controller.js index ea091656..e537dcc 100644 --- a/ios/chrome/browser/passwords/resources/password_controller.js +++ b/ios/chrome/browser/passwords/resources/password_controller.js
@@ -298,7 +298,14 @@ filled = true; } } else { + // Setting input fields via .value assignment does not trigger all + // the events that a web site can observe. This has the effect of + // certain web sites rejecting an autofilled sign in form as not + // signed in because the user didn't actually "typed" into the field. + // Adding the .focus() works around this problems. + usernameInput.focus(); usernameInput.value = username; + passwordInput.focus(); passwordInput.value = password; __gCrWeb.setAutofilled(passwordInput, true); __gCrWeb.setAutofilled(usernameInput, true);
diff --git a/ios/chrome/browser/ui/payments/payment_items_display_view_controller.mm b/ios/chrome/browser/ui/payments/payment_items_display_view_controller.mm index 0b25265..425e008 100644 --- a/ios/chrome/browser/ui/payments/payment_items_display_view_controller.mm +++ b/ios/chrome/browser/ui/payments/payment_items_display_view_controller.mm
@@ -10,6 +10,7 @@ #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item+collection_view_controller.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" #import "ios/chrome/browser/ui/collection_view/collection_view_model.h" +#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/browser/ui/icons/chrome_icon.h" #import "ios/chrome/browser/ui/payments/cells/price_item.h" #import "ios/chrome/browser/ui/payments/payment_items_display_view_controller_actions.h" @@ -74,6 +75,7 @@ _payButton = [[MDCButton alloc] init]; [_payButton setTitle:l10n_util::GetNSString(IDS_PAYMENTS_PAY_BUTTON) forState:UIControlStateNormal]; + [_payButton setBackgroundColor:[[MDCPalette cr_bluePalette] tint500]]; [_payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_payButton setInkColor:[UIColor colorWithWhite:1 alpha:0.2]];
diff --git a/ios/chrome/browser/ui/payments/payment_request_view_controller.mm b/ios/chrome/browser/ui/payments/payment_request_view_controller.mm index baedd72..c9150a0 100644 --- a/ios/chrome/browser/ui/payments/payment_request_view_controller.mm +++ b/ios/chrome/browser/ui/payments/payment_request_view_controller.mm
@@ -106,6 +106,7 @@ _payButton = [[MDCButton alloc] init]; [_payButton setTitle:l10n_util::GetNSString(IDS_PAYMENTS_PAY_BUTTON) forState:UIControlStateNormal]; + [_payButton setBackgroundColor:[[MDCPalette cr_bluePalette] tint500]]; [_payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_payButton setInkColor:[UIColor colorWithWhite:1 alpha:0.2]];
diff --git a/ios/chrome/browser/ui/settings/autofill_settings_egtest.mm b/ios/chrome/browser/ui/settings/autofill_settings_egtest.mm index 2760f045..43ae141 100644 --- a/ios/chrome/browser/ui/settings/autofill_settings_egtest.mm +++ b/ios/chrome/browser/ui/settings/autofill_settings_egtest.mm
@@ -78,40 +78,6 @@ stringWithFormat:@"%@_textField", l10n_util::GetNSString(categoryId)]; } -// Call this in the "Edit Address" view to clear the Country value. The case -// of the value being empty is handled gracefully. -void ClearCountryValue() { - // Switch on edit mode. - [[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabelId( - IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON)] - performAction:grey_tap()]; - - // The test only can tap "Select All" if there is a text to select. Type "a" - // to ensure that. - [[EarlGrey selectElementWithMatcher:grey_accessibilityID(GetTextFieldForID( - IDS_IOS_AUTOFILL_COUNTRY))] - performAction:grey_typeText(@"a")]; - // Remove the country value by select all + cut. - [[EarlGrey selectElementWithMatcher:grey_accessibilityID(GetTextFieldForID( - IDS_IOS_AUTOFILL_COUNTRY))] - performAction:grey_longPress()]; - [[EarlGrey - selectElementWithMatcher:grey_allOf( - grey_accessibilityLabel(@"Select All"), - grey_accessibilityTrait( - UIAccessibilityTraitStaticText), - nil)] performAction:grey_tap()]; - [[EarlGrey - selectElementWithMatcher:grey_allOf(grey_accessibilityLabel(@"Cut"), - grey_accessibilityTrait( - UIAccessibilityTraitStaticText), - nil)] performAction:grey_tap()]; - - // Switch off edit mode. - [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] - performAction:grey_tap()]; -} - } // namespace // Various tests for the Autofill section of the settings. @@ -179,27 +145,20 @@ // Test that editing country names is followed by validating the value and // replacing it with a canonical one. - (void)testAutofillProfileEditing { - // TODO(crbug.com/747431): re-enable this test on iOS 11. - if (base::ios::IsRunningOnIOS11OrLater()) { - EARL_GREY_TEST_DISABLED(@"Disabled on iOS 11."); - } - [self loadAndSubmitTheForm]; [self openEditAddress:@"George Washington, 1600 Pennsylvania Ave NW"]; // Keep editing the Country field and verify that validation works. for (const UserTypedCountryExpectedResultPair& expectation : kCountryTests) { - ClearCountryValue(); - // Switch on edit mode. [[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabelId( IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON)] performAction:grey_tap()]; - // Type the user-version of the country. + // Replace the text field with the user-version of the country. [[EarlGrey selectElementWithMatcher:grey_accessibilityID(GetTextFieldForID( IDS_IOS_AUTOFILL_COUNTRY))] - performAction:grey_typeText(expectation.user_typed_country)]; + performAction:grey_replaceText(expectation.user_typed_country)]; // Switch off edit mode. [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
diff --git a/ios/web/browser_state_web_view_partition_inttest.mm b/ios/web/browser_state_web_view_partition_inttest.mm index 00396e9e..d5233d5e 100644 --- a/ios/web/browser_state_web_view_partition_inttest.mm +++ b/ios/web/browser_state_web_view_partition_inttest.mm
@@ -137,17 +137,17 @@ // Tests that cookies are partitioned between web views created with a // non-OTR BrowserState and an OTR BrowserState. // Flaky: crbug/684024 -TEST_F(BrowserStateWebViewPartitionTest, DISABLED_Cookies) { +TEST_F(BrowserStateWebViewPartitionTest, FLAKY_Cookies) { WKWebView* web_view_1 = web::BuildWKWebView(CGRectZero, GetBrowserState()); LoadTestWebPage(web_view_1); SetCookie(@"someCookieName1", @"someCookieValue1", web_view_1); - EXPECT_NSEQ(@"someCookieName1=someCookieValue1", GetCookies(web_view_1)); + ASSERT_NSEQ(@"someCookieName1=someCookieValue1", GetCookies(web_view_1)); WKWebView* web_view_2 = web::BuildWKWebView(CGRectZero, GetOtrBrowserState()); LoadTestWebPage(web_view_2); // Test that the cookie has not leaked over to |web_view_2|. - EXPECT_NSEQ(@"", GetCookies(web_view_2)); + ASSERT_NSEQ(@"", GetCookies(web_view_2)); SetCookie(@"someCookieName2", @"someCookieValue2", web_view_2); EXPECT_NSEQ(@"someCookieName2=someCookieValue2", GetCookies(web_view_2));
diff --git a/ios/web/interstitials/web_interstitial_impl.mm b/ios/web/interstitials/web_interstitial_impl.mm index d41f72ea..d1edf85 100644 --- a/ios/web/interstitials/web_interstitial_impl.mm +++ b/ios/web/interstitials/web_interstitial_impl.mm
@@ -56,7 +56,7 @@ } void WebInterstitialImpl::Hide() { - GetWebStateImpl()->ClearTransientContentView(); + GetWebStateImpl()->ClearTransientContent(); } void WebInterstitialImpl::DontProceed() {
diff --git a/ios/web/navigation/legacy_navigation_manager_impl.h b/ios/web/navigation/legacy_navigation_manager_impl.h index b7617e4a..039caef 100644 --- a/ios/web/navigation/legacy_navigation_manager_impl.h +++ b/ios/web/navigation/legacy_navigation_manager_impl.h
@@ -57,11 +57,7 @@ BrowserState* GetBrowserState() const override; WebState* GetWebState() const override; NavigationItem* GetVisibleItem() const override; - NavigationItem* GetLastCommittedItem() const override; - NavigationItem* GetPendingItem() const override; - NavigationItem* GetTransientItem() const override; void DiscardNonCommittedItems() override; - void LoadURLWithParams(const NavigationManager::WebLoadParams&) override; int GetItemCount() const override; NavigationItem* GetItemAtIndex(size_t index) const override; int GetIndexOfItem(const NavigationItem* item) const override; @@ -84,8 +80,11 @@ // NavigationManagerImpl. friend SessionStorageBuilder; - // NavigationManagerImpl methods used by SessionStorageBuilder. + // NavigationManagerImpl: NavigationItemImpl* GetNavigationItemImplAtIndex(size_t index) const override; + NavigationItemImpl* GetLastCommittedItemImpl() const override; + NavigationItemImpl* GetPendingItemImpl() const override; + NavigationItemImpl* GetTransientItemImpl() const override; // Returns true if the PageTransition for the underlying navigation item at // |index| has ui::PAGE_TRANSITION_IS_REDIRECT_MASK.
diff --git a/ios/web/navigation/legacy_navigation_manager_impl.mm b/ios/web/navigation/legacy_navigation_manager_impl.mm index d1678afd..3c27687 100644 --- a/ios/web/navigation/legacy_navigation_manager_impl.mm +++ b/ios/web/navigation/legacy_navigation_manager_impl.mm
@@ -140,27 +140,10 @@ return [session_controller_ visibleItem]; } -NavigationItem* LegacyNavigationManagerImpl::GetLastCommittedItem() const { - return [session_controller_ lastCommittedItem]; -} - -NavigationItem* LegacyNavigationManagerImpl::GetPendingItem() const { - return [session_controller_ pendingItem]; -} - -NavigationItem* LegacyNavigationManagerImpl::GetTransientItem() const { - return [session_controller_ transientItem]; -} - void LegacyNavigationManagerImpl::DiscardNonCommittedItems() { [session_controller_ discardNonCommittedItems]; } -void LegacyNavigationManagerImpl::LoadURLWithParams( - const NavigationManager::WebLoadParams& params) { - delegate_->LoadURLWithParams(params); -} - int LegacyNavigationManagerImpl::GetItemCount() const { return [session_controller_ items].size(); } @@ -303,6 +286,19 @@ return result; } +NavigationItemImpl* LegacyNavigationManagerImpl::GetLastCommittedItemImpl() + const { + return [session_controller_ lastCommittedItem]; +} + +NavigationItemImpl* LegacyNavigationManagerImpl::GetPendingItemImpl() const { + return [session_controller_ pendingItem]; +} + +NavigationItemImpl* LegacyNavigationManagerImpl::GetTransientItemImpl() const { + return [session_controller_ transientItem]; +} + bool LegacyNavigationManagerImpl::IsRedirectItemAtIndex(int index) const { DCHECK_GE(index, 0); DCHECK_LT(index, GetItemCount());
diff --git a/ios/web/navigation/navigation_manager_delegate.h b/ios/web/navigation/navigation_manager_delegate.h index c4d544a..3f9e104 100644 --- a/ios/web/navigation/navigation_manager_delegate.h +++ b/ios/web/navigation/navigation_manager_delegate.h
@@ -26,8 +26,23 @@ // moved to NavigationManagerImpl. virtual void GoToIndex(int index) = 0; - // Instructs the delegate to load the URL. - virtual void LoadURLWithParams(const NavigationManager::WebLoadParams&) = 0; + // Instructs the delegate to clear any transient content to prepare for new + // navigation. + virtual void ClearTransientContent() = 0; + + // Instructs the delegate to record page states (e.g. scroll position, form + // values, whatever can be harvested) from the current page into the + // navigation item. + virtual void RecordPageStateInNavigationItem() = 0; + + // Instructs the delegate to notify its delegates that the current navigation + // item will be loaded. + virtual void WillLoadCurrentItemWithParams( + const NavigationManager::WebLoadParams&, + bool is_initial_navigation) = 0; + + // Instructs the delegate to load the current navigation item. + virtual void LoadCurrentItem() = 0; // Instructs the delegate to reload. virtual void Reload() = 0;
diff --git a/ios/web/navigation/navigation_manager_impl.h b/ios/web/navigation/navigation_manager_impl.h index 3ecb5e7..92e9fdb 100644 --- a/ios/web/navigation/navigation_manager_impl.h +++ b/ios/web/navigation/navigation_manager_impl.h
@@ -132,8 +132,12 @@ NavigationInitiationType initiation_type); // NavigationManager: + NavigationItem* GetLastCommittedItem() const final; + NavigationItem* GetPendingItem() const final; + NavigationItem* GetTransientItem() const final; + void LoadURLWithParams(const NavigationManager::WebLoadParams&) final; void AddTransientURLRewriter(BrowserURLRewriter::URLRewriter rewriter) final; - void Reload(ReloadType reload_type, bool check_for_reposts) override; + void Reload(ReloadType reload_type, bool check_for_reposts) final; protected: // The SessionStorageBuilder functions require access to private variables of @@ -172,6 +176,11 @@ virtual NavigationItemImpl* GetNavigationItemImplAtIndex( size_t index) const = 0; + // Implementation for corresponding NavigationManager getters. + virtual NavigationItemImpl* GetPendingItemImpl() const = 0; + virtual NavigationItemImpl* GetTransientItemImpl() const = 0; + virtual NavigationItemImpl* GetLastCommittedItemImpl() const = 0; + // The primary delegate for this manager. NavigationManagerDelegate* delegate_;
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm index 8af30a5..012954fa 100644 --- a/ios/web/navigation/navigation_manager_impl.mm +++ b/ios/web/navigation/navigation_manager_impl.mm
@@ -127,6 +127,71 @@ return item; } +NavigationItem* NavigationManagerImpl::GetLastCommittedItem() const { + return GetLastCommittedItemImpl(); +} + +NavigationItem* NavigationManagerImpl::GetPendingItem() const { + return GetPendingItemImpl(); +} + +NavigationItem* NavigationManagerImpl::GetTransientItem() const { + return GetTransientItemImpl(); +} + +void NavigationManagerImpl::LoadURLWithParams( + const NavigationManager::WebLoadParams& params) { + DCHECK(!(params.transition_type & ui::PAGE_TRANSITION_FORWARD_BACK)); + delegate_->ClearTransientContent(); + delegate_->RecordPageStateInNavigationItem(); + + bool is_initial_navigation = !GetItemCount(); + + NavigationInitiationType initiation_type = + params.is_renderer_initiated + ? NavigationInitiationType::RENDERER_INITIATED + : NavigationInitiationType::USER_INITIATED; + AddPendingItem(params.url, params.referrer, params.transition_type, + initiation_type, params.user_agent_override_option); + + // Mark pending item as created from hash change if necessary. This is needed + // because window.hashchange message may not arrive on time. + NavigationItemImpl* pending_item = GetPendingItemImpl(); + if (pending_item) { + NavigationItem* last_committed_item = GetLastCommittedItem(); + GURL last_committed_url = last_committed_item + ? last_committed_item->GetVirtualURL() + : GURL::EmptyGURL(); + GURL pending_url = pending_item->GetURL(); + if (last_committed_url != pending_url && + last_committed_url.EqualsIgnoringRef(pending_url)) { + pending_item->SetIsCreatedFromHashChange(true); + } + } + + // Add additional headers to the NavigationItem before loading it in the web + // view. This implementation must match CRWWebController's |currentNavItem|. + // However, to avoid introducing a GetCurrentItem() that is only used here, + // the logic in |currentNavItem| is inlined here with the small simplification + // since AddPendingItem() implies that any transient item would have been + // cleared. + DCHECK(!GetTransientItem()); + NavigationItemImpl* added_item = + pending_item ? pending_item : GetLastCommittedItemImpl(); + DCHECK(added_item); + if (params.extra_headers) + added_item->AddHttpRequestHeaders(params.extra_headers); + if (params.post_data) { + DCHECK([added_item->GetHttpRequestHeaders() objectForKey:@"Content-Type"]) + << "Post data should have an associated content type"; + added_item->SetPostData(params.post_data); + added_item->SetShouldSkipRepostFormConfirmation(true); + } + + delegate_->WillLoadCurrentItemWithParams(params, is_initial_navigation); + delegate_->LoadCurrentItem(); +} + void NavigationManagerImpl::AddTransientURLRewriter( BrowserURLRewriter::URLRewriter rewriter) { DCHECK(rewriter);
diff --git a/ios/web/navigation/navigation_manager_impl_unittest.mm b/ios/web/navigation/navigation_manager_impl_unittest.mm index 937bc786..713469e3 100644 --- a/ios/web/navigation/navigation_manager_impl_unittest.mm +++ b/ios/web/navigation/navigation_manager_impl_unittest.mm
@@ -13,12 +13,15 @@ #import "ios/web/navigation/legacy_navigation_manager_impl.h" #import "ios/web/navigation/navigation_manager_delegate.h" #import "ios/web/navigation/wk_based_navigation_manager_impl.h" +#include "ios/web/public/load_committed_details.h" #include "ios/web/public/navigation_item.h" #include "ios/web/public/test/fakes/test_browser_state.h" #import "ios/web/test/fakes/crw_test_back_forward_list.h" #include "ios/web/test/test_url_constants.h" #import "ios/web/web_state/ui/crw_web_view_navigation_proxy.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" #include "third_party/ocmock/OCMock/OCMock.h" #include "url/scheme_host_port.h" @@ -57,34 +60,40 @@ return false; } -// Stub class for NavigationManagerDelegate. +// Mock class for NavigationManagerDelegate. class TestNavigationManagerDelegate : public NavigationManagerDelegate { public: - bool reload_called() { return reload_called_; } void SetSessionController(CRWSessionController* session_controller) { session_controller_ = session_controller; } + void SetWKWebView(id web_view) { mock_web_view_ = web_view; } + MOCK_METHOD0(ClearTransientContent, void()); + MOCK_METHOD0(RecordPageStateInNavigationItem, void()); + MOCK_METHOD2(WillLoadCurrentItemWithParams, + void(const NavigationManager::WebLoadParams&, bool)); + MOCK_METHOD0(LoadCurrentItem, void()); + MOCK_METHOD0(Reload, void()); + MOCK_METHOD1(OnNavigationItemsPruned, void(size_t)); + MOCK_METHOD0(OnNavigationItemChanged, void()); + MOCK_METHOD1(OnNavigationItemCommitted, void(const LoadCommittedDetails&)); + private: - // NavigationManagerDelegate overrides. void GoToIndex(int index) override { [session_controller_ goToItemAtIndex:index discardNonCommittedItems:NO]; } - void LoadURLWithParams(const NavigationManager::WebLoadParams&) override {} - void Reload() override { reload_called_ = true; } - void OnNavigationItemsPruned(size_t pruned_item_count) override {} - void OnNavigationItemChanged() override {} - void OnNavigationItemCommitted(const LoadCommittedDetails&) override {} + WebState* GetWebState() override { return nullptr; } + id<CRWWebViewNavigationProxy> GetWebViewNavigationProxy() const override { return mock_web_view_; } - bool reload_called_ = false; CRWSessionController* session_controller_; id mock_web_view_; }; + } // namespace // NavigationManagerTest is parameterized on this enum to test both the legacy @@ -115,6 +124,7 @@ OCMStub([mock_web_view_ backForwardList]).andReturn(mock_wk_list_); delegate_.SetWKWebView(mock_web_view_); } + // Setup rewriter. BrowserURLRewriter::GetInstance()->AddURLRewriter(UrlRewriter); url::AddStandardScheme(kSchemeToRewrite, url::SCHEME_WITHOUT_PORT); @@ -127,7 +137,7 @@ CRWSessionController* session_controller() { return controller_; } NavigationManagerImpl* navigation_manager() { return manager_.get(); } - TestNavigationManagerDelegate navigation_manager_delegate() { + TestNavigationManagerDelegate& navigation_manager_delegate() { return delegate_; } @@ -1439,9 +1449,9 @@ ASSERT_FALSE(navigation_manager()->GetPendingItem()); ASSERT_FALSE(navigation_manager()->GetLastCommittedItem()); + EXPECT_CALL(navigation_manager_delegate(), Reload()).Times(0); navigation_manager()->Reload(web::ReloadType::NORMAL, false /* check_for_repost */); - EXPECT_FALSE(navigation_manager_delegate().reload_called()); ASSERT_FALSE(navigation_manager()->GetTransientItem()); ASSERT_FALSE(navigation_manager()->GetPendingItem()); @@ -1457,9 +1467,9 @@ web::NavigationInitiationType::RENDERER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); + EXPECT_CALL(navigation_manager_delegate(), Reload()).Times(1); navigation_manager()->Reload(web::ReloadType::NORMAL, false /* check_for_repost */); - EXPECT_TRUE(navigation_manager_delegate().reload_called()); ASSERT_TRUE(navigation_manager()->GetPendingItem()); EXPECT_EQ(url_before_reload, @@ -1475,9 +1485,9 @@ web::NavigationInitiationType::USER_INITIATED, web::NavigationManager::UserAgentOverrideOption::INHERIT); + EXPECT_CALL(navigation_manager_delegate(), Reload()).Times(1); navigation_manager()->Reload(web::ReloadType::NORMAL, false /* check_for_repost */); - EXPECT_TRUE(navigation_manager_delegate().reload_called()); ASSERT_TRUE(navigation_manager()->GetPendingItem()); EXPECT_EQ(url_before_reload, @@ -1506,9 +1516,9 @@ forwardListURLs:nil]; navigation_manager()->CommitPendingItem(); + EXPECT_CALL(navigation_manager_delegate(), Reload()).Times(1); navigation_manager()->Reload(web::ReloadType::NORMAL, false /* check_for_repost */); - EXPECT_TRUE(navigation_manager_delegate().reload_called()); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(url_before_reload, @@ -1559,9 +1569,9 @@ navigation_manager()->GoToIndex(1); EXPECT_EQ(1, navigation_manager()->GetLastCommittedItemIndex()); + EXPECT_CALL(navigation_manager_delegate(), Reload()).Times(1); navigation_manager()->Reload(web::ReloadType::NORMAL, false /* check_for_repost */); - EXPECT_TRUE(navigation_manager_delegate().reload_called()); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(url_before_reload, @@ -1575,9 +1585,9 @@ ASSERT_FALSE(navigation_manager()->GetPendingItem()); ASSERT_FALSE(navigation_manager()->GetLastCommittedItem()); + EXPECT_CALL(navigation_manager_delegate(), Reload()).Times(0); navigation_manager()->Reload(web::ReloadType::ORIGINAL_REQUEST_URL, false /* check_for_repost */); - EXPECT_FALSE(navigation_manager_delegate().reload_called()); ASSERT_FALSE(navigation_manager()->GetTransientItem()); ASSERT_FALSE(navigation_manager()->GetPendingItem()); @@ -1597,9 +1607,9 @@ navigation_manager()->GetPendingItem()->SetOriginalRequestURL( expected_original_url); + EXPECT_CALL(navigation_manager_delegate(), Reload()).Times(1); navigation_manager()->Reload(web::ReloadType::ORIGINAL_REQUEST_URL, false /* check_for_repost */); - EXPECT_TRUE(navigation_manager_delegate().reload_called()); ASSERT_TRUE(navigation_manager()->GetPendingItem()); EXPECT_EQ(expected_original_url, @@ -1619,9 +1629,9 @@ navigation_manager()->GetPendingItem()->SetOriginalRequestURL( expected_original_url); + EXPECT_CALL(navigation_manager_delegate(), Reload()).Times(1); navigation_manager()->Reload(web::ReloadType::ORIGINAL_REQUEST_URL, false /* check_for_repost */); - EXPECT_TRUE(navigation_manager_delegate().reload_called()); ASSERT_TRUE(navigation_manager()->GetPendingItem()); EXPECT_EQ(expected_original_url, @@ -1654,9 +1664,9 @@ forwardListURLs:nil]; navigation_manager()->CommitPendingItem(); + EXPECT_CALL(navigation_manager_delegate(), Reload()).Times(1); navigation_manager()->Reload(web::ReloadType::ORIGINAL_REQUEST_URL, false /* check_for_repost */); - EXPECT_TRUE(navigation_manager_delegate().reload_called()); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(expected_original_url, @@ -1710,9 +1720,9 @@ navigation_manager()->GoToIndex(1); EXPECT_EQ(1, navigation_manager()->GetLastCommittedItemIndex()); + EXPECT_CALL(navigation_manager_delegate(), Reload()).Times(1); navigation_manager()->Reload(web::ReloadType::ORIGINAL_REQUEST_URL, false /* check_for_repost */); - EXPECT_TRUE(navigation_manager_delegate().reload_called()); ASSERT_TRUE(navigation_manager()->GetLastCommittedItem()); EXPECT_EQ(expected_original_url, @@ -2077,6 +2087,70 @@ navigation_manager()->GetVisibleItem()->GetURL().spec()); } +// Tests that |extra_headers| and |post_data| from WebLoadParams are added to +// the new navigation item if they are present. +TEST_P(NavigationManagerTest, LoadURLWithParamsWithExtraHeadersAndPostData) { + NavigationManager::WebLoadParams params(GURL("http://www.url.com/0")); + params.transition_type = ui::PAGE_TRANSITION_TYPED; + params.extra_headers.reset(@{@"Content-Type" : @"text/plain"}); + params.post_data.reset([NSData data]); + + EXPECT_CALL(navigation_manager_delegate(), RecordPageStateInNavigationItem()) + .Times(1); + EXPECT_CALL(navigation_manager_delegate(), ClearTransientContent()).Times(1); + EXPECT_CALL(navigation_manager_delegate(), + WillLoadCurrentItemWithParams(::testing::Ref(params), + true /* is_initial_navigation */)); + EXPECT_CALL(navigation_manager_delegate(), LoadCurrentItem()).Times(1); + + navigation_manager()->LoadURLWithParams(params); + + NavigationItem* pending_item = navigation_manager()->GetPendingItem(); + ASSERT_TRUE(pending_item); + EXPECT_EQ("http://www.url.com/0", pending_item->GetURL().spec()); + EXPECT_TRUE(ui::PageTransitionCoreTypeIs(pending_item->GetTransitionType(), + ui::PAGE_TRANSITION_TYPED)); + EXPECT_NSEQ(pending_item->GetHttpRequestHeaders(), + @{@"Content-Type" : @"text/plain"}); + EXPECT_TRUE(pending_item->HasPostData()); +} + +// Tests that LoadURLWithParams() calls RecordPageStateInNavigationItem() on the +// navigation manager deleget before navigating to the new URL. +TEST_P(NavigationManagerTest, LoadURLWithParamsSavesStateOnCurrentItem) { + navigation_manager()->AddPendingItem( + GURL("http://www.url.com/0"), Referrer(), ui::PAGE_TRANSITION_TYPED, + web::NavigationInitiationType::USER_INITIATED, + web::NavigationManager::UserAgentOverrideOption::INHERIT); + + [mock_wk_list_ setCurrentURL:@"http://www.url.com/0"]; + navigation_manager()->CommitPendingItem(); + + NavigationManager::WebLoadParams params(GURL("http://www.url.com/1")); + params.transition_type = ui::PAGE_TRANSITION_TYPED; + + EXPECT_CALL(navigation_manager_delegate(), RecordPageStateInNavigationItem()) + .Times(1); + EXPECT_CALL(navigation_manager_delegate(), ClearTransientContent()).Times(1); + EXPECT_CALL(navigation_manager_delegate(), + WillLoadCurrentItemWithParams(::testing::Ref(params), + false /* is_initial_navigation */)); + EXPECT_CALL(navigation_manager_delegate(), LoadCurrentItem()).Times(1); + + navigation_manager()->LoadURLWithParams(params); + + NavigationItem* last_committed_item = + navigation_manager()->GetLastCommittedItem(); + ASSERT_TRUE(last_committed_item); + EXPECT_EQ("http://www.url.com/0", last_committed_item->GetURL().spec()); + NavigationItem* pending_item = navigation_manager()->GetPendingItem(); + ASSERT_TRUE(pending_item); + EXPECT_EQ("http://www.url.com/1", pending_item->GetURL().spec()); + EXPECT_TRUE(ui::PageTransitionCoreTypeIs(pending_item->GetTransitionType(), + ui::PAGE_TRANSITION_TYPED)); + EXPECT_FALSE(pending_item->HasPostData()); +} + INSTANTIATE_TEST_CASE_P( ProgrammaticNavigationManagerTest, NavigationManagerTest,
diff --git a/ios/web/navigation/wk_based_navigation_manager_impl.h b/ios/web/navigation/wk_based_navigation_manager_impl.h index e19a581..84a8191 100644 --- a/ios/web/navigation/wk_based_navigation_manager_impl.h +++ b/ios/web/navigation/wk_based_navigation_manager_impl.h
@@ -82,12 +82,7 @@ BrowserState* GetBrowserState() const override; WebState* GetWebState() const override; NavigationItem* GetVisibleItem() const override; - NavigationItem* GetLastCommittedItem() const override; - // Returns the pending navigation item in the main frame. - NavigationItem* GetPendingItem() const override; - NavigationItem* GetTransientItem() const override; void DiscardNonCommittedItems() override; - void LoadURLWithParams(const NavigationManager::WebLoadParams&) override; int GetItemCount() const override; NavigationItem* GetItemAtIndex(size_t index) const override; int GetIndexOfItem(const NavigationItem* item) const override; @@ -110,11 +105,12 @@ // NavigationManagerImpl. friend SessionStorageBuilder; - // NavigationManagerImpl methods used by SessionStorageBuilder. + // NavigationManagerImpl: NavigationItemImpl* GetNavigationItemImplAtIndex(size_t index) const override; - - // NavigationManagerImpl version of GetPendingItem(). - NavigationItemImpl* GetPendingItemImpl() const; + NavigationItemImpl* GetLastCommittedItemImpl() const override; + // Returns the pending navigation item in the main frame. + NavigationItemImpl* GetPendingItemImpl() const override; + NavigationItemImpl* GetTransientItemImpl() const override; // Returns the absolute index of WKBackForwardList's |currentItem|. Returns -1 // if |currentItem| is nil.
diff --git a/ios/web/navigation/wk_based_navigation_manager_impl.mm b/ios/web/navigation/wk_based_navigation_manager_impl.mm index 0b29968d..210db38 100644 --- a/ios/web/navigation/wk_based_navigation_manager_impl.mm +++ b/ios/web/navigation/wk_based_navigation_manager_impl.mm
@@ -229,30 +229,11 @@ return GetLastCommittedItem(); } -NavigationItem* WKBasedNavigationManagerImpl::GetLastCommittedItem() const { - int index = GetLastCommittedItemIndex(); - return index == -1 ? nullptr : GetItemAtIndex(static_cast<size_t>(index)); -} - -NavigationItem* WKBasedNavigationManagerImpl::GetPendingItem() const { - return GetPendingItemImpl(); -} - -NavigationItem* WKBasedNavigationManagerImpl::GetTransientItem() const { - return transient_item_.get(); -} - void WKBasedNavigationManagerImpl::DiscardNonCommittedItems() { pending_item_.reset(); transient_item_.reset(); } -void WKBasedNavigationManagerImpl::LoadURLWithParams( - const NavigationManager::WebLoadParams&) { - DLOG(WARNING) << "Not yet implemented."; -} - - int WKBasedNavigationManagerImpl::GetItemCount() const { id<CRWWebViewNavigationProxy> proxy = delegate_->GetWebViewNavigationProxy(); if (proxy) { @@ -402,12 +383,23 @@ return GetNavigationItemFromWKItem(wk_item); } +NavigationItemImpl* WKBasedNavigationManagerImpl::GetLastCommittedItemImpl() + const { + int index = GetLastCommittedItemIndex(); + return index == -1 ? nullptr + : GetNavigationItemImplAtIndex(static_cast<size_t>(index)); +} + NavigationItemImpl* WKBasedNavigationManagerImpl::GetPendingItemImpl() const { return (pending_item_index_ == -1) ? pending_item_.get() : GetNavigationItemImplAtIndex(pending_item_index_); } +NavigationItemImpl* WKBasedNavigationManagerImpl::GetTransientItemImpl() const { + return transient_item_.get(); +} + int WKBasedNavigationManagerImpl::GetWKCurrentItemIndex() const { id<CRWWebViewNavigationProxy> proxy = delegate_->GetWebViewNavigationProxy(); if (proxy.backForwardList.currentItem) {
diff --git a/ios/web/test/fakes/test_navigation_manager_delegate.h b/ios/web/test/fakes/test_navigation_manager_delegate.h index 521c1d3..78805d97 100644 --- a/ios/web/test/fakes/test_navigation_manager_delegate.h +++ b/ios/web/test/fakes/test_navigation_manager_delegate.h
@@ -14,7 +14,11 @@ class TestNavigationManagerDelegate : public NavigationManagerDelegate { public: void GoToIndex(int index) override; - void LoadURLWithParams(const NavigationManager::WebLoadParams&) override; + void ClearTransientContent() override; + void RecordPageStateInNavigationItem() override; + void WillLoadCurrentItemWithParams(const NavigationManager::WebLoadParams&, + bool is_initial_navigation) override; + void LoadCurrentItem() override; void Reload() override; void OnNavigationItemsPruned(size_t pruned_item_count) override; void OnNavigationItemChanged() override;
diff --git a/ios/web/test/fakes/test_navigation_manager_delegate.mm b/ios/web/test/fakes/test_navigation_manager_delegate.mm index df850759..9e39879 100644 --- a/ios/web/test/fakes/test_navigation_manager_delegate.mm +++ b/ios/web/test/fakes/test_navigation_manager_delegate.mm
@@ -12,8 +12,12 @@ namespace web { void TestNavigationManagerDelegate::GoToIndex(int index) {} -void TestNavigationManagerDelegate::LoadURLWithParams( - const NavigationManager::WebLoadParams&) {} +void TestNavigationManagerDelegate::ClearTransientContent() {} +void TestNavigationManagerDelegate::RecordPageStateInNavigationItem() {} +void TestNavigationManagerDelegate::WillLoadCurrentItemWithParams( + const NavigationManager::WebLoadParams&, + bool is_initial_navigation) {} +void TestNavigationManagerDelegate::LoadCurrentItem() {} void TestNavigationManagerDelegate::Reload() {} void TestNavigationManagerDelegate::OnNavigationItemsPruned( size_t pruned_item_count) {}
diff --git a/ios/web/web_state/ui/crw_web_controller.h b/ios/web/web_state/ui/crw_web_controller.h index 8619a60..0c43ec7 100644 --- a/ios/web/web_state/ui/crw_web_controller.h +++ b/ios/web/web_state/ui/crw_web_controller.h
@@ -115,7 +115,9 @@ // view will be dismissed for the next navigation. - (void)showTransientContentView:(CRWContentView*)contentView; -// Clear the transient content view, if one is shown. +// Clear the transient content view, if one is shown. This is a delegate +// method for WebStateImpl::ClearTransientContent(). Callers should use the +// WebStateImpl API instead of calling this method directly. - (void)clearTransientContentView; // Call to stop the CRWWebController from doing stuff, in particular to @@ -153,11 +155,13 @@ // to generate an overlay placeholder view. - (BOOL)canUseViewForGeneratingOverlayPlaceholderView; -// Start loading the URL specified in |params|, with the specified -// settings. Always resets the openedByScript property to NO. -// NOTE: |params.transition_type| should never be PAGE_TRANSITION_RELOAD except -// for transient items, if one needs to reload, call |-reload| explicitly. -- (void)loadWithParams:(const web::NavigationManager::WebLoadParams&)params; +// Notifies delegate that |currentNavItem| will be loaded with |params|. If this +// is the first navigation, |isInitialNavigation| is YES. +// TODO(crbug.com/674991): Remove this method when CRWWebDelegate is no longer +// used. +- (void)willLoadCurrentItemWithParams: + (const web::NavigationManager::WebLoadParams&)params + isInitialNavigation:(BOOL)isInitialNavigation; // Loads the URL indicated by current session state. - (void)loadCurrentURL;
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index b36c29c..3198faa 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -507,8 +507,6 @@ - (void)didStartLoadingURL:(const GURL&)URL; // Returns YES if the URL looks like it is one CRWWebController can show. + (BOOL)webControllerCanShow:(const GURL&)url; -// Clears the currently-displayed transient content view. -- (void)clearTransientContentView; // Returns a lazily created CRWTouchTrackingRecognizer. - (CRWTouchTrackingRecognizer*)touchTrackingRecognizer; // Shows placeholder overlay. @@ -996,10 +994,6 @@ // Remove the transient content view from the hierarchy. [_containerView clearTransientContentView]; - - // Notify the WebState so it can perform any required state cleanup. - if (_webStateImpl) - _webStateImpl->ClearTransientContentView(); } - (void)showTransientContentView:(CRWContentView*)contentView { @@ -1095,7 +1089,7 @@ if (enabled) { // Don't create the web view; let it be lazy created as needed. } else { - [self clearTransientContentView]; + _webStateImpl->ClearTransientContent(); [self removeWebView]; _touchTrackingRecognizer.get().touchTrackingDelegate = nil; _touchTrackingRecognizer.reset(); @@ -1801,57 +1795,11 @@ navigationContext:navigationContext.get()]; } -- (void)loadWithParams:(const NavigationManager::WebLoadParams&)params { - DCHECK(!(params.transition_type & ui::PAGE_TRANSITION_FORWARD_BACK)); - - // Clear transient view before making any changes to history and navigation - // manager. TODO(stuartmorgan): Drive Transient Item clearing from - // navigation system, rather than from WebController. - [self clearTransientContentView]; - - [self recordStateInHistory]; - - BOOL initialNavigation = !self.currentNavItem; - - web::NavigationInitiationType navigationInitiationType = - params.is_renderer_initiated - ? web::NavigationInitiationType::RENDERER_INITIATED - : web::NavigationInitiationType::USER_INITIATED; - self.navigationManagerImpl->AddPendingItem( - params.url, params.referrer, params.transition_type, - navigationInitiationType, params.user_agent_override_option); - - // Mark pending item as created from hash change if necessary. This is needed - // because window.hashchange message may not arrive on time. - // TODO(crbug.com/738020) Using static_cast for down-cast is not safe in the - // long run. Move this block to NavigationManager if the nav experiment is - // successful. - web::NavigationItemImpl* pendingItem = static_cast<web::NavigationItemImpl*>( - self.navigationManagerImpl->GetPendingItem()); - if (pendingItem) { - GURL lastCommittedURL = _webStateImpl->GetLastCommittedURL(); - GURL pendingURL = pendingItem->GetURL(); - if (lastCommittedURL != pendingURL && - lastCommittedURL.EqualsIgnoringRef(pendingURL)) { - pendingItem->SetIsCreatedFromHashChange(true); - } - } - - web::NavigationItemImpl* addedItem = self.currentNavItem; - DCHECK(addedItem); - if (params.extra_headers) - addedItem->AddHttpRequestHeaders(params.extra_headers); - if (params.post_data) { - DCHECK([addedItem->GetHttpRequestHeaders() objectForKey:@"Content-Type"]) - << "Post data should have an associated content type"; - addedItem->SetPostData(params.post_data); - addedItem->SetShouldSkipRepostFormConfirmation(true); - } - +- (void)willLoadCurrentItemWithParams: + (const NavigationManager::WebLoadParams&)params + isInitialNavigation:(BOOL)isInitialNavigation { [_delegate webDidUpdateSessionForLoadWithParams:params - wasInitialNavigation:initialNavigation]; - - [self loadCurrentURL]; + wasInitialNavigation:isInitialNavigation]; } - (void)loadCurrentURL { @@ -1869,8 +1817,7 @@ [self abortLoad]; DCHECK(!_isHalted); - // Remove the transient content view. - [self clearTransientContentView]; + _webStateImpl->ClearTransientContent(); web::NavigationItem* item = self.currentNavItem; const GURL currentURL = item ? item->GetURL() : GURL::EmptyGURL(); @@ -2000,7 +1947,7 @@ reloadParams.transition_type = ui::PAGE_TRANSITION_RELOAD; reloadParams.extra_headers.reset( [transientItem->GetHttpRequestHeaders() copy]); - [self loadWithParams:reloadParams]; + self.webState->GetNavigationManager()->LoadURLWithParams(reloadParams); } else { self.currentNavItem->SetTransitionType( ui::PageTransition::PAGE_TRANSITION_RELOAD); @@ -2037,7 +1984,7 @@ if (!_webStateImpl->IsShowingWebInterstitial()) [self recordStateInHistory]; - [self clearTransientContentView]; + _webStateImpl->ClearTransientContent(); // Update the user agent before attempting the navigation. // TODO(crbug.com/736103): due to the bug, updating the user agent of web view @@ -4099,7 +4046,7 @@ - (void)loadHTML:(NSString*)HTML forURL:(const GURL&)URL { DCHECK(HTML.length); // Remove the transient content view. - [self clearTransientContentView]; + _webStateImpl->ClearTransientContent(); _loadPhase = web::LOAD_REQUESTED; @@ -4413,7 +4360,7 @@ if (web::GetWebClient()->IsAppSpecificURL(_documentURL)) { [self abortLoad]; NavigationManager::WebLoadParams params(webViewURL); - [self loadWithParams:params]; + self.webState->GetNavigationManager()->LoadURLWithParams(params); } return; } @@ -4947,8 +4894,8 @@ std::unique_ptr<web::NavigationContextImpl> newNavigationContext; if (!_changingHistoryState) { if ([self contextForPendingNavigationWithURL:newURL]) { - // |loadWithParams:| was called with URL that has different fragment - // comparing to the previous URL. + // NavigationManager::LoadURLWithParams() was called with URL that has + // different fragment comparing to the previous URL. } else { // This could be: // 1.) Renderer-initiated fragment change
diff --git a/ios/web/web_state/web_state_impl.h b/ios/web/web_state/web_state_impl.h index 22eb8adf..13d09a7 100644 --- a/ios/web/web_state/web_state_impl.h +++ b/ios/web/web_state/web_state_impl.h
@@ -223,9 +223,6 @@ // Adds |interstitial|'s view to the web controller's content view. void ShowWebInterstitial(WebInterstitialImpl* interstitial); - // Called to dismiss the currently-displayed transient content view. - void ClearTransientContentView(); - // Notifies the delegate that the load progress was updated. void SendChangeLoadProgress(double progress); // Notifies the delegate that a context menu needs handling. @@ -264,7 +261,11 @@ // NavigationManagerDelegate: void GoToIndex(int index) override; - void LoadURLWithParams(const NavigationManager::WebLoadParams&) override; + void ClearTransientContent() override; + void RecordPageStateInNavigationItem() override; + void WillLoadCurrentItemWithParams(const NavigationManager::WebLoadParams&, + bool is_initial_navigation) override; + void LoadCurrentItem() override; void Reload() override; void OnNavigationItemsPruned(size_t pruned_item_count) override; void OnNavigationItemChanged() override;
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm index dd27c66..db1c3d6c 100644 --- a/ios/web/web_state/web_state_impl.mm +++ b/ios/web/web_state/web_state_impl.mm
@@ -409,22 +409,6 @@ ShowTransientContentView(interstitial_->GetContentView()); } -void WebStateImpl::ClearTransientContentView() { - if (interstitial_) { - // Store the currently displayed interstitial in a local variable and reset - // |interstitial_| early. This is to prevent an infinite loop, as - // |DontProceed()| internally calls |ClearTransientContentView()|. - web::WebInterstitial* interstitial = interstitial_; - interstitial_ = nullptr; - interstitial->DontProceed(); - // Don't access |interstitial| after calling |DontProceed()|, as it triggers - // deletion. - for (auto& observer : observers_) - observer.InterstitialDismissed(); - } - [web_controller_ clearTransientContentView]; -} - void WebStateImpl::SendChangeLoadProgress(double progress) { for (auto& observer : observers_) observer.LoadProgressChanged(progress); @@ -598,7 +582,7 @@ void WebStateImpl::OpenURL(const WebState::OpenURLParams& params) { DCHECK(Configured()); - ClearTransientContentView(); + ClearTransientContent(); if (delegate_) delegate_->OpenURLFromWebState(this, params); } @@ -748,9 +732,35 @@ [web_controller_ goToItemAtIndex:index]; } -void WebStateImpl::LoadURLWithParams( - const NavigationManager::WebLoadParams& params) { - [web_controller_ loadWithParams:params]; +void WebStateImpl::ClearTransientContent() { + if (interstitial_) { + // Store the currently displayed interstitial in a local variable and reset + // |interstitial_| early. This is to prevent an infinite loop, as + // |DontProceed()| internally calls |ClearTransientContent()|. + web::WebInterstitial* interstitial = interstitial_; + interstitial_ = nullptr; + interstitial->DontProceed(); + // Don't access |interstitial| after calling |DontProceed()|, as it triggers + // deletion. + for (auto& observer : observers_) + observer.InterstitialDismissed(); + } + [web_controller_ clearTransientContentView]; +} + +void WebStateImpl::RecordPageStateInNavigationItem() { + [web_controller_ recordStateInHistory]; +} + +void WebStateImpl::WillLoadCurrentItemWithParams( + const NavigationManager::WebLoadParams& params, + bool is_initial_navigation) { + [web_controller_ willLoadCurrentItemWithParams:params + isInitialNavigation:is_initial_navigation]; +} + +void WebStateImpl::LoadCurrentItem() { + [web_controller_ loadCurrentURL]; } void WebStateImpl::Reload() {
diff --git a/media/audio/OWNERS b/media/audio/OWNERS index 6485207e..9bb0552 100644 --- a/media/audio/OWNERS +++ b/media/audio/OWNERS
@@ -1,4 +1,6 @@ tommi@chromium.org +olka@chromium.org +maxmorin@chromium.org # Windows henrika@chromium.org
diff --git a/media/base/OWNERS b/media/base/OWNERS new file mode 100644 index 0000000..c83a845 --- /dev/null +++ b/media/base/OWNERS
@@ -0,0 +1 @@ +per-file *audio*=file://media/audio/OWNERS
diff --git a/media/blink/webmediaplayer_cast_android.cc b/media/blink/webmediaplayer_cast_android.cc index 8fadd78..9b227c8 100644 --- a/media/blink/webmediaplayer_cast_android.cc +++ b/media/blink/webmediaplayer_cast_android.cc
@@ -15,6 +15,7 @@ #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/skia/include/core/SkCanvas.h" +#include "third_party/skia/include/core/SkFontStyle.h" #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/core/SkTypeface.h" @@ -64,8 +65,7 @@ paint.setAntiAlias(true); paint.setFilterQuality(kHigh_SkFilterQuality); paint.setColor(SK_ColorWHITE); - paint.setTypeface(SkTypeface::MakeFromName( - "sans", SkFontStyle::FromOldStyle(SkTypeface::kBold))); + paint.setTypeface(SkTypeface::MakeFromName("sans", SkFontStyle::Bold())); paint.setTextSize(kTextSize); // Calculate the vertical margin from the top
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index 3f218f8..58843581 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc
@@ -2156,12 +2156,11 @@ return false; // Check if form text selection needs to be updated. - if (in_form_text_area_) { - SetFormSelectedText(form_, pages_[last_page_mouse_down_]->GetPage()); - } + FPDF_PAGE page = pages_[last_page_mouse_down_]->GetPage(); + if (in_form_text_area_) + SetFormSelectedText(form_, page); - return !!FORM_OnKeyUp(form_, pages_[last_page_mouse_down_]->GetPage(), - event.GetKeyCode(), event.GetModifiers()); + return !!FORM_OnKeyUp(form_, page, event.GetKeyCode(), event.GetModifiers()); } bool PDFiumEngine::OnChar(const pp::KeyboardInputEvent& event) { @@ -3681,9 +3680,10 @@ depth = static_cast<uint32_t>(depth * 1.5) + 1; // We need to check depth only to verify our copy of shadow matrix is correct. - if (!page_shadow_.get() || page_shadow_->depth() != depth) - page_shadow_.reset( - new ShadowMatrix(depth, factor, client_->GetBackgroundColor())); + if (!page_shadow_.get() || page_shadow_->depth() != depth) { + page_shadow_ = base::MakeUnique<ShadowMatrix>( + depth, factor, client_->GetBackgroundColor()); + } DCHECK(!image_data->is_null()); DrawShadow(image_data, shadow_rect, page_rect, clip_rect, *page_shadow_);
diff --git a/ppapi/features/features.gni b/ppapi/features/features.gni index ac17e1f..560d1ec 100644 --- a/ppapi/features/features.gni +++ b/ppapi/features/features.gni
@@ -7,5 +7,5 @@ import("//build/config/features.gni") declare_args() { - enable_plugins = !is_android && !is_ios && !is_chromecast + enable_plugins = !is_android && !is_ios && !is_chromecast && !is_fuchsia }
diff --git a/remoting/host/setup/daemon_controller_delegate_mac.mm b/remoting/host/setup/daemon_controller_delegate_mac.mm index e0d17da..29ada31a 100644 --- a/remoting/host/setup/daemon_controller_delegate_mac.mm +++ b/remoting/host/setup/daemon_controller_delegate_mac.mm
@@ -271,7 +271,7 @@ DaemonControllerDelegateMac::GetUsageStatsConsent() { DaemonController::UsageStatsConsent consent; consent.supported = true; - consent.allowed = false; + consent.allowed = true; // set_by_policy is not yet supported. consent.set_by_policy = false;
diff --git a/remoting/host/setup/daemon_controller_delegate_win.cc b/remoting/host/setup/daemon_controller_delegate_win.cc index 376e439..ce44a4b 100644 --- a/remoting/host/setup/daemon_controller_delegate_win.cc +++ b/remoting/host/setup/daemon_controller_delegate_win.cc
@@ -422,7 +422,7 @@ DaemonControllerDelegateWin::GetUsageStatsConsent() { DaemonController::UsageStatsConsent consent; consent.supported = true; - consent.allowed = false; + consent.allowed = true; consent.set_by_policy = false; // Get the recorded user's consent.
diff --git a/remoting/ios/app/host_view_controller.mm b/remoting/ios/app/host_view_controller.mm index 552e506..98b988c 100644 --- a/remoting/ios/app/host_view_controller.mm +++ b/remoting/ios/app/host_view_controller.mm
@@ -216,6 +216,12 @@ #pragma mark - Keyboard Notifications - (void)keyboardWillShow:(NSNotification*)notification { + // The soft keyboard can be triggered by the PhysicalKeyboardDetector, in this + // case we don't need to change the keyboard size. + if (!_clientKeyboard.isFirstResponder) { + return; + } + if (_blocksKeyboard) { // This is to make sure the keyboard is removed from the responder chain. [_clientKeyboard removeFromSuperview]; @@ -233,6 +239,10 @@ } - (void)keyboardWillHide:(NSNotification*)notification { + if (!_clientKeyboard.isFirstResponder) { + return; + } + [self setKeyboardSize:CGSizeZero needsLayout:YES]; }
diff --git a/services/viz/public/cpp/compositing/compositor_frame_for_blink.typemap b/services/viz/public/cpp/compositing/compositor_frame_for_blink.typemap index 1d2a62c..f397f3f 100644 --- a/services/viz/public/cpp/compositing/compositor_frame_for_blink.typemap +++ b/services/viz/public/cpp/compositing/compositor_frame_for_blink.typemap
@@ -8,7 +8,6 @@ "//cc/ipc/filter_operation_struct_traits.h", "//cc/ipc/filter_operations_struct_traits.h", "//cc/ipc/shared_quad_state_struct_traits.h", - "//cc/ipc/transferable_resource_struct_traits.h", "//gpu/ipc/common/mailbox_holder_struct_traits.h", "//gpu/ipc/common/mailbox_struct_traits.h", "//gpu/ipc/common/sync_token_struct_traits.h", @@ -19,6 +18,7 @@ "//services/viz/public/cpp/compositing/quads_struct_traits.h", "//services/viz/public/cpp/compositing/render_pass_struct_traits.h", "//services/viz/public/cpp/compositing/selection_struct_traits.h", + "//services/viz/public/cpp/compositing/transferable_resource_struct_traits.h", "//skia/public/interfaces/image_filter_struct_traits.h", "//ui/gfx/mojo/selection_bound_struct_traits.h", "//ui/gfx/mojo/transform_struct_traits.h",
diff --git a/services/viz/public/cpp/compositing/compositor_frame_struct_traits.cc b/services/viz/public/cpp/compositing/compositor_frame_struct_traits.cc index 5397356..6b855435 100644 --- a/services/viz/public/cpp/compositing/compositor_frame_struct_traits.cc +++ b/services/viz/public/cpp/compositing/compositor_frame_struct_traits.cc
@@ -5,9 +5,9 @@ #include "services/viz/public/cpp/compositing/compositor_frame_struct_traits.h" #include "base/trace_event/trace_event.h" -#include "cc/ipc/transferable_resource_struct_traits.h" #include "services/viz/public/cpp/compositing/compositor_frame_metadata_struct_traits.h" #include "services/viz/public/cpp/compositing/render_pass_struct_traits.h" +#include "services/viz/public/cpp/compositing/transferable_resource_struct_traits.h" namespace mojo {
diff --git a/services/viz/public/cpp/compositing/compositor_frame_struct_traits.h b/services/viz/public/cpp/compositing/compositor_frame_struct_traits.h index c85ce80..d0ad395 100644 --- a/services/viz/public/cpp/compositing/compositor_frame_struct_traits.h +++ b/services/viz/public/cpp/compositing/compositor_frame_struct_traits.h
@@ -8,6 +8,7 @@ #include <vector> #include "cc/output/compositor_frame.h" +#include "services/viz/public/cpp/compositing/transferable_resource_struct_traits.h" #include "services/viz/public/interfaces/compositing/compositor_frame.mojom-shared.h" namespace mojo {
diff --git a/services/viz/public/cpp/compositing/struct_traits_unittest.cc b/services/viz/public/cpp/compositing/struct_traits_unittest.cc index 4170414..2b5a97c 100644 --- a/services/viz/public/cpp/compositing/struct_traits_unittest.cc +++ b/services/viz/public/cpp/compositing/struct_traits_unittest.cc
@@ -15,7 +15,6 @@ #include "cc/ipc/shared_quad_state_struct_traits.h" #include "cc/ipc/surface_id_struct_traits.h" #include "cc/ipc/texture_mailbox_struct_traits.h" -#include "cc/ipc/transferable_resource_struct_traits.h" #include "cc/output/compositor_frame.h" #include "cc/quads/debug_border_draw_quad.h" #include "cc/quads/render_pass.h" @@ -41,10 +40,12 @@ #include "services/viz/public/cpp/compositing/selection_struct_traits.h" #include "services/viz/public/cpp/compositing/surface_info_struct_traits.h" #include "services/viz/public/cpp/compositing/surface_sequence_struct_traits.h" +#include "services/viz/public/cpp/compositing/transferable_resource_struct_traits.h" #include "services/viz/public/interfaces/compositing/compositor_frame.mojom.h" #include "services/viz/public/interfaces/compositing/returned_resource.mojom.h" #include "services/viz/public/interfaces/compositing/surface_info.mojom.h" #include "services/viz/public/interfaces/compositing/surface_sequence.mojom.h" +#include "services/viz/public/interfaces/compositing/transferable_resource.mojom.h" #include "skia/public/interfaces/bitmap_skbitmap_struct_traits.h" #include "skia/public/interfaces/blur_image_filter_tile_mode_struct_traits.h" #include "skia/public/interfaces/image_filter_struct_traits.h" @@ -721,6 +722,59 @@ EXPECT_EQ(matrix, out_stream_video_draw_quad->matrix); } +TEST_F(StructTraitsTest, TransferableResource) { + const uint32_t id = 1337; + const ResourceFormat format = ALPHA_8; + const uint32_t filter = 1234; + const gfx::Size size(1234, 5678); + const int8_t mailbox_name[GL_MAILBOX_SIZE_CHROMIUM] = { + 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2}; + const gpu::CommandBufferNamespace command_buffer_namespace = gpu::IN_PROCESS; + const int32_t extra_data_field = 0xbeefbeef; + const gpu::CommandBufferId command_buffer_id( + gpu::CommandBufferId::FromUnsafeValue(0xdeadbeef)); + const uint64_t release_count = 0xdeadbeefdeadL; + const uint32_t texture_target = 1337; + const bool read_lock_fences_enabled = true; + const bool is_software = false; + const uint32_t shared_bitmap_sequence_number = 123456; + const bool is_overlay_candidate = true; + + gpu::MailboxHolder mailbox_holder; + mailbox_holder.mailbox.SetName(mailbox_name); + mailbox_holder.sync_token = + gpu::SyncToken(command_buffer_namespace, extra_data_field, + command_buffer_id, release_count); + mailbox_holder.texture_target = texture_target; + TransferableResource input; + input.id = id; + input.format = format; + input.filter = filter; + input.size = size; + input.mailbox_holder = mailbox_holder; + input.read_lock_fences_enabled = read_lock_fences_enabled; + input.is_software = is_software; + input.shared_bitmap_sequence_number = shared_bitmap_sequence_number; + input.is_overlay_candidate = is_overlay_candidate; + + TransferableResource output; + SerializeAndDeserialize<mojom::TransferableResource>(input, &output); + + EXPECT_EQ(id, output.id); + EXPECT_EQ(format, output.format); + EXPECT_EQ(filter, output.filter); + EXPECT_EQ(size, output.size); + EXPECT_EQ(mailbox_holder.mailbox, output.mailbox_holder.mailbox); + EXPECT_EQ(mailbox_holder.sync_token, output.mailbox_holder.sync_token); + EXPECT_EQ(mailbox_holder.texture_target, + output.mailbox_holder.texture_target); + EXPECT_EQ(read_lock_fences_enabled, output.read_lock_fences_enabled); + EXPECT_EQ(is_software, output.is_software); + EXPECT_EQ(shared_bitmap_sequence_number, + output.shared_bitmap_sequence_number); + EXPECT_EQ(is_overlay_candidate, output.is_overlay_candidate); +} + TEST_F(StructTraitsTest, YUVDrawQuad) { std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); render_pass->SetNew(1, gfx::Rect(), gfx::Rect(), gfx::Transform());
diff --git a/services/viz/public/cpp/compositing/transferable_resource.typemap b/services/viz/public/cpp/compositing/transferable_resource.typemap new file mode 100644 index 0000000..40c5152 --- /dev/null +++ b/services/viz/public/cpp/compositing/transferable_resource.typemap
@@ -0,0 +1,12 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +mojom = + "//services/viz/public/interfaces/compositing/transferable_resource.mojom" +public_headers = [ "//components/viz/common/resources/transferable_resource.h" ] +traits_headers = [ "//services/viz/public/cpp/compositing/transferable_resource_struct_traits.h" ] +sources = [ + "//services/viz/public/cpp/compositing/transferable_resource_struct_traits.cc", +] +type_mappings = [ "viz.mojom.TransferableResource=viz::TransferableResource" ]
diff --git a/cc/ipc/transferable_resource_struct_traits.cc b/services/viz/public/cpp/compositing/transferable_resource_struct_traits.cc similarity index 87% rename from cc/ipc/transferable_resource_struct_traits.cc rename to services/viz/public/cpp/compositing/transferable_resource_struct_traits.cc index b9baf49..bcd1378 100644 --- a/cc/ipc/transferable_resource_struct_traits.cc +++ b/services/viz/public/cpp/compositing/transferable_resource_struct_traits.cc
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/ipc/transferable_resource_struct_traits.h" +#include "services/viz/public/cpp/compositing/transferable_resource_struct_traits.h" + #include "base/trace_event/trace_event.h" #include "gpu/ipc/common/mailbox_holder_struct_traits.h" #include "gpu/ipc/common/mailbox_struct_traits.h" @@ -12,9 +13,9 @@ namespace mojo { // static -bool StructTraits<cc::mojom::TransferableResourceDataView, +bool StructTraits<viz::mojom::TransferableResourceDataView, viz::TransferableResource>:: - Read(cc::mojom::TransferableResourceDataView data, + Read(viz::mojom::TransferableResourceDataView data, viz::TransferableResource* out) { TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.ipc"), "StructTraits::TransferableResource::Read");
diff --git a/cc/ipc/transferable_resource_struct_traits.h b/services/viz/public/cpp/compositing/transferable_resource_struct_traits.h similarity index 79% rename from cc/ipc/transferable_resource_struct_traits.h rename to services/viz/public/cpp/compositing/transferable_resource_struct_traits.h index ee56d461..922145a0 100644 --- a/cc/ipc/transferable_resource_struct_traits.h +++ b/services/viz/public/cpp/compositing/transferable_resource_struct_traits.h
@@ -2,25 +2,26 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ -#define CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ +#ifndef SERVICES_VIZ_PUBLIC_CPP_COMPOSITING_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ +#define SERVICES_VIZ_PUBLIC_CPP_COMPOSITING_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ -#include "cc/ipc/transferable_resource.mojom-shared.h" +#include "build/build_config.h" #include "components/viz/common/resources/transferable_resource.h" +#include "services/viz/public/interfaces/compositing/transferable_resource.mojom-shared.h" #include "ui/gfx/ipc/color/gfx_param_traits.h" namespace mojo { template <> -struct StructTraits<cc::mojom::TransferableResourceDataView, +struct StructTraits<viz::mojom::TransferableResourceDataView, viz::TransferableResource> { static uint32_t id(const viz::TransferableResource& resource) { return resource.id; } - static cc::mojom::ResourceFormat format( + static viz::mojom::ResourceFormat format( const viz::TransferableResource& resource) { - return static_cast<cc::mojom::ResourceFormat>(resource.format); + return static_cast<viz::mojom::ResourceFormat>(resource.format); } static gfx::mojom::BufferFormat buffer_format( @@ -85,10 +86,10 @@ return resource.color_space; } - static bool Read(cc::mojom::TransferableResourceDataView data, + static bool Read(viz::mojom::TransferableResourceDataView data, viz::TransferableResource* out); }; } // namespace mojo -#endif // CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ +#endif // SERVICES_VIZ_PUBLIC_CPP_COMPOSITING_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_
diff --git a/services/viz/public/cpp/compositing/typemaps.gni b/services/viz/public/cpp/compositing/typemaps.gni index e5cd112..f0c8342 100644 --- a/services/viz/public/cpp/compositing/typemaps.gni +++ b/services/viz/public/cpp/compositing/typemaps.gni
@@ -11,4 +11,5 @@ "//services/viz/public/cpp/compositing/selection.typemap", "//services/viz/public/cpp/compositing/surface_sequence.typemap", "//services/viz/public/cpp/compositing/surface_info.typemap", + "//services/viz/public/cpp/compositing/transferable_resource.typemap", ]
diff --git a/services/viz/public/interfaces/compositing/BUILD.gn b/services/viz/public/interfaces/compositing/BUILD.gn index 91a4d5d..5e99e8f 100644 --- a/services/viz/public/interfaces/compositing/BUILD.gn +++ b/services/viz/public/interfaces/compositing/BUILD.gn
@@ -17,6 +17,7 @@ "shared_bitmap_allocation_notifier.mojom", "surface_info.mojom", "surface_sequence.mojom", + "transferable_resource.mojom", ] public_deps = [
diff --git a/services/viz/public/interfaces/compositing/compositor_frame.mojom b/services/viz/public/interfaces/compositing/compositor_frame.mojom index 954acf4..a92717f 100644 --- a/services/viz/public/interfaces/compositing/compositor_frame.mojom +++ b/services/viz/public/interfaces/compositing/compositor_frame.mojom
@@ -4,13 +4,13 @@ module viz.mojom; -import "cc/ipc/transferable_resource.mojom"; import "services/viz/public/interfaces/compositing/compositor_frame_metadata.mojom"; import "services/viz/public/interfaces/compositing/render_pass.mojom"; +import "services/viz/public/interfaces/compositing/transferable_resource.mojom"; // See src/cc/output/compositor_frame.h. struct CompositorFrame { CompositorFrameMetadata metadata; - array<cc.mojom.TransferableResource> resources; + array<TransferableResource> resources; array<RenderPass> passes; };
diff --git a/cc/ipc/transferable_resource.mojom b/services/viz/public/interfaces/compositing/transferable_resource.mojom similarity index 97% rename from cc/ipc/transferable_resource.mojom rename to services/viz/public/interfaces/compositing/transferable_resource.mojom index 81696f6..366514d 100644 --- a/cc/ipc/transferable_resource.mojom +++ b/services/viz/public/interfaces/compositing/transferable_resource.mojom
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module cc.mojom; +module viz.mojom; import "gpu/ipc/common/mailbox_holder.mojom"; import "ui/gfx/geometry/mojo/geometry.mojom";
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index e734274..bb1edca 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h
@@ -224,6 +224,11 @@ #define SK_SUPPORT_LEGACY_RP_BLENDS #endif +// Transition from Gaussian filtering for small sigma to linear filtering +#ifndef SK_SUPPORT_LEGACY_USE_GAUSS_FOR_SMALL_RADII +#define SK_SUPPORT_LEGACY_USE_GAUSS_FOR_SMALL_RADII +#endif + ///////////////////////// Imported from BUILD.gn and skia_common.gypi /* In some places Skia can use static initializers for global initialization,
diff --git a/testing/buildbot/filters/fuchsia.net_unittests.filter b/testing/buildbot/filters/fuchsia.net_unittests.filter index d18ec7f..e92f1f1 100644 --- a/testing/buildbot/filters/fuchsia.net_unittests.filter +++ b/testing/buildbot/filters/fuchsia.net_unittests.filter
@@ -14,6 +14,7 @@ -DiskCache* -EffectiveConnectionTypeTest* -EmbeddedTestServer* +-HttpCache.RangeGET_ParallelValidationDifferentRanges # crbug.com/755552 -HttpNetworkTransactionTest.UploadUnreadableFile -HttpServerTest.* -NetworkInterfacesTest.GetNetworkList
diff --git a/third_party/WebKit/LayoutTests/LeakExpectations b/third_party/WebKit/LayoutTests/LeakExpectations index ada5eab..702ff84 100644 --- a/third_party/WebKit/LayoutTests/LeakExpectations +++ b/third_party/WebKit/LayoutTests/LeakExpectations
@@ -40,6 +40,8 @@ crbug.com/672740 virtual/mojo-loading/http/tests/security/mixedContent/websocket/insecure-websocket-in-secure-page-worker.html [ Leak Pass ] crbug.com/754222 external/wpt/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse-manual.html [ Leak Pass ] +crbug.com/755625 external/wpt/beacon/beacon-error.window.html [ Leak ] + # ----------------------------------------------------------------- # Known as false positives # -----------------------------------------------------------------
diff --git a/third_party/WebKit/LayoutTests/SlowTests b/third_party/WebKit/LayoutTests/SlowTests index d5399107f..22deb70 100644 --- a/third_party/WebKit/LayoutTests/SlowTests +++ b/third_party/WebKit/LayoutTests/SlowTests
@@ -399,30 +399,35 @@ crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-blending-gradient-over-image.html [ Slow ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-blending-gradient-over-pattern.html [ Slow ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-blending-pattern-over-gradient.html [ Slow ] +crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-blending-pattern-over-image.html [ Slow ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-blending-pattern-over-pattern.html [ Slow ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-composite-shadow.html [ Slow ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-composite-video-shadow.html [ Slow ] +crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-fillPath-alpha-shadow.html [ Slow ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-fillPath-pattern-shadow.html [ Slow ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-filter-origin-clean.html [ Slow ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-filter-removed.html [ Slow ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-scale-strokePath-shadow.html [ Slow ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-shadow-source-in.html [ Slow ] +crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/canvas-strokePath-alpha-shadow.html [ Slow ] crbug.com/726075 [ Win Debug ] css3/blending/mix-blend-mode-with-filters.html [ Slow ] crbug.com/726075 [ Win Debug ] paint/invalidation/filter-repaint-accelerated-child-with-filter-child.html [ Slow ] crbug.com/726075 [ Win Debug ] paint/invalidation/filter-repaint-on-accelerated-layer.html [ Slow ] +crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-clipping.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-color-over-color.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-color-over-gradient.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-color-over-image.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-fill-style.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-global-alpha.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-gradient-over-color.html [ Slow ] +crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-gradient-over-gradient.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-image-over-color.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-image-over-gradient.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-image-over-image.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-image-over-pattern.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-pattern-over-color.html [ Slow ] -crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-pattern-over-image.html [ Slow ] +crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-shadow.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-text.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-blending-transforms.html [ Slow ] crbug.com/726075 [ Win Debug ] virtual/gpu/fast/canvas/canvas-composite-transformclip.html [ Slow ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 9c9b55b..95b7cf4b 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -87,6 +87,7 @@ crbug.com/726075 [ Win ] compositing/3d-cube.html [ Failure ] crbug.com/726075 [ Win ] virtual/gpu/fast/canvas/2d.fillText.gradient.html [ Failure ] crbug.com/726075 [ Win ] external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_remove_cue_while_paused.html [ Failure ] +crbug.com/726075 [ Win Debug ] virtual/exotic-color-space/images/color-profile-border-fade.html [ Failure ] # SwiftShader WebGL2 related crashes crbug.com/726075 [ Win ] external/wpt/offscreen-canvas/the-offscreen-canvas/offscreencanvas.getcontext.html [ Crash ] @@ -1752,6 +1753,9 @@ crbug.com/626703 virtual/threaded/transitions/transition-end-event-multiple-03.html [ Pass Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 external/wpt/beacon/beacon-cors.sub.window.html [ Timeout ] +crbug.com/626703 external/wpt/beacon/beacon-navigate.html [ Timeout ] +crbug.com/626703 external/wpt/beacon/beacon-redirect.window.html [ Timeout ] crbug.com/626703 external/wpt/css/css-fonts-3/alternates-order.html [ Failure ] crbug.com/626703 external/wpt/css/css-fonts-3/font-family-name-000.xht [ Skip ] crbug.com/626703 external/wpt/css/css-fonts-3/font-family-name-001.xht [ Skip ] @@ -2239,7 +2243,7 @@ crbug.com/626703 external/wpt/css/css-ui-3/text-overflow-011.html [ Failure Crash Pass ] crbug.com/626703 external/wpt/workers/opaque-origin.html [ Failure Crash Timeout ] crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/margin-collapsing-quirks/multicol-quirks-mode.html [ Pass Crash ] -crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/margin-collapsing-quirks/multicol-standards-mode.html [ Pass Crash ] +crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/margin-collapsing-quirks/multicol-standards-mode.html [ Pass Crash Failure ] crbug.com/720545 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-1.htm [ Crash Pass ] crbug.com/720545 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-2.htm [ Crash Pass ] crbug.com/720545 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-3.htm [ Crash Pass ] @@ -3429,3 +3433,47 @@ crbug.com/755405 [ Android ] virtual/layout_ng/fast/block/margin-collapse/019.html [ Failure Crash ] crbug.com/755405 [ Android ] virtual/mojo-localstorage/external/wpt/webstorage/storage_enumerate.html [ Failure ] crbug.com/755405 [ Android ] virtual/rootlayerscrolls/fast/scrolling/scrollable-area-overflow-auto-display-none-in-parent.html [ Failure ] +crbug.com/755405 [ Android ] compositing/sibling-positioning.html [ Failure ] +crbug.com/755405 [ Android ] css3/selectors3/html/css3-modsel-18.html [ Failure Crash ] +crbug.com/755405 [ Android ] css3/selectors3/html/css3-modsel-61.html [ Failure Crash ] +crbug.com/755405 [ Android ] css3/selectors3/xhtml/css3-modsel-17.xml [ Failure Crash ] +crbug.com/755405 [ Android ] css3/selectors3/xhtml/css3-modsel-18.xml [ Failure Crash ] +crbug.com/755405 [ Android ] css3/selectors3/xml/css3-modsel-17.xml [ Failure ] +crbug.com/755405 [ Android ] css3/selectors3/xml/css3-modsel-18.xml [ Failure ] +crbug.com/755405 [ Android ] css3/selectors3/xml/css3-modsel-61.xml [ Failure ] +crbug.com/755405 [ Android ] editing/execCommand/5190926.html [ Failure ] +crbug.com/755405 [ Android ] editing/inserting/5156401-2.html [ Failure ] +crbug.com/755405 [ Android ] editing/pasteboard/drop-text-without-selection.html [ Failure ] +crbug.com/755405 [ Android ] editing/pasteboard/paste-line-endings-001.html [ Failure ] +crbug.com/755405 [ Android ] editing/pasteboard/paste-line-endings-002.html [ Failure ] +crbug.com/755405 [ Android ] editing/pasteboard/paste-line-endings-003.html [ Failure ] +crbug.com/755405 [ Android ] editing/pasteboard/paste-line-endings-004.html [ Failure ] +crbug.com/755405 [ Android ] editing/pasteboard/paste-line-endings-005.html [ Failure ] +crbug.com/755405 [ Android ] editing/pasteboard/paste-text-016.html [ Failure ] +crbug.com/755405 [ Android ] editing/selection/4402375.html [ Failure ] +crbug.com/755405 [ Android ] editing/selection/6476.html [ Failure ] +crbug.com/755405 [ Android ] editing/selection/leave-requested-block.html [ Failure ] +crbug.com/755405 [ Android ] editing/selection/previous-line-position.html [ Failure ] +crbug.com/755405 [ Android ] editing/style/block-styles-007.html [ Failure ] +crbug.com/755405 [ Android ] fast/backgrounds/background-clip-text.html [ Failure ] +crbug.com/755405 [ Android ] fast/css/child-style-can-override-visited-style.html [ Failure ] +crbug.com/755405 [ Android ] fast/css/clip-zooming.html [ Failure ] +crbug.com/755405 [ Android ] fast/css/compare-content-style.html [ Failure ] +crbug.com/755405 [ Android ] fast/css/first-letter-hover.html [ Failure ] +crbug.com/755405 [ Android ] fast/css/first-letter-visibility.html [ Failure ] +crbug.com/755405 [ Android ] fast/css/focus-ring-multiline.html [ Failure ] +crbug.com/755405 [ Android ] fast/css/invalid-percentage-property.html [ Failure ] +crbug.com/755405 [ Android ] fast/css/line-height-font-order.html [ Failure ] +crbug.com/755405 [ Android ] fast/css/nth-child-dynamic.html [ Failure ] +crbug.com/755405 [ Android ] fast/events/reveal-link-when-focused.html [ Failure ] +crbug.com/755405 [ Android ] fast/layers/normal-flow-hit-test.html [ Failure ] +crbug.com/755405 [ Android ] fast/layers/opacity-transforms.html [ Failure ] +crbug.com/755405 [ Android ] fast/selectors/018.html [ Failure ] +crbug.com/755405 [ Android ] fast/selectors/061.html [ Failure ] +crbug.com/755405 [ Android ] images/imagemap-focus-ring-outline-color-not-inherited-from-map.html [ Failure ] +crbug.com/755405 [ Android ] paint/invalidation/focus-layers.html [ Failure ] +crbug.com/755405 [ Android ] paint/invalidation/selected-replaced.html [ Failure ] +crbug.com/755405 [ Android ] paint/invalidation/shadow-multiple.html [ Failure ] +crbug.com/755405 [ Android ] svg/as-background-image/svg-width-100p-as-background.html [ Failure ] +crbug.com/755405 [ Android ] svg/batik/text/textAnchor3.svg [ Failure ] +crbug.com/755405 [ Android ] transforms/transformed-caret.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites index 0670d44e..360c54d42 100644 --- a/third_party/WebKit/LayoutTests/VirtualTestSuites +++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -352,6 +352,11 @@ "args": ["--force-device-scale-factor=2"] }, { + "prefix": "scalefactor200", + "base": "external/wpt/css-paint-api/hidpi", + "args": ["--force-device-scale-factor=2"] + }, + { "prefix": "scalefactor150", "base": "fast/hidpi/static", "args": ["--force-device-scale-factor=1.5"]
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json index 2ed8335..3fbd775 100644 --- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -68432,11 +68432,21 @@ {} ] ], + "XMLHttpRequest/resources/access-control-basic-denied.py": [ + [ + {} + ] + ], "XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py": [ [ {} ] ], + "XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py": [ + [ + {} + ] + ], "XMLHttpRequest/resources/access-control-origin-header.py": [ [ {} @@ -68967,6 +68977,21 @@ {} ] ], + "beacon/beacon-basic-blob-expected.txt": [ + [ + {} + ] + ], + "beacon/beacon-basic-blobMax-expected.txt": [ + [ + {} + ] + ], + "beacon/beacon-common.sub.js": [ + [ + {} + ] + ], "beacon/headers/header-content-type-expected.txt": [ [ {} @@ -68997,6 +69022,16 @@ {} ] ], + "beacon/navigate.iFrame.sub.html": [ + [ + {} + ] + ], + "beacon/resources/beacon.py": [ + [ + {} + ] + ], "beacon/resources/content-type.py": [ [ {} @@ -111887,6 +111922,11 @@ {} ] ], + "payment-request/payment-request-ctor-pmi-handling.https-expected.txt": [ + [ + {} + ] + ], "payment-request/payment-request-id.https-expected.txt": [ [ {} @@ -119132,6 +119172,11 @@ {} ] ], + "webvtt/api/VTTRegion/id-expected.txt": [ + [ + {} + ] + ], "webvtt/api/categories.json": [ [ {} @@ -129593,6 +129638,12 @@ {} ] ], + "XMLHttpRequest/access-control-basic-allow-access-control-origin-header-data-url.htm": [ + [ + "/XMLHttpRequest/access-control-basic-allow-access-control-origin-header-data-url.htm", + {} + ] + ], "XMLHttpRequest/access-control-basic-allow-access-control-origin-header.htm": [ [ "/XMLHttpRequest/access-control-basic-allow-access-control-origin-header.htm", @@ -129617,6 +129668,12 @@ {} ] ], + "XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm": [ + [ + "/XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm", + {} + ] + ], "XMLHttpRequest/access-control-basic-allow-star.htm": [ [ "/XMLHttpRequest/access-control-basic-allow-star.htm", @@ -129629,6 +129686,12 @@ {} ] ], + "XMLHttpRequest/access-control-basic-denied.htm": [ + [ + "/XMLHttpRequest/access-control-basic-denied.htm", + {} + ] + ], "XMLHttpRequest/allow-lists-starting-with-comma.htm": [ [ "/XMLHttpRequest/allow-lists-starting-with-comma.htm", @@ -130955,6 +131018,96 @@ {} ] ], + "beacon/beacon-basic-blob.html": [ + [ + "/beacon/beacon-basic-blob.html", + { + "timeout": "long" + } + ] + ], + "beacon/beacon-basic-blobMax.html": [ + [ + "/beacon/beacon-basic-blobMax.html", + { + "timeout": "long" + } + ] + ], + "beacon/beacon-basic-buffersource.html": [ + [ + "/beacon/beacon-basic-buffersource.html", + { + "timeout": "long" + } + ] + ], + "beacon/beacon-basic-buffersourceMax.html": [ + [ + "/beacon/beacon-basic-buffersourceMax.html", + { + "timeout": "long" + } + ] + ], + "beacon/beacon-basic-formdata.html": [ + [ + "/beacon/beacon-basic-formdata.html", + { + "timeout": "long" + } + ] + ], + "beacon/beacon-basic-formdataMax.html": [ + [ + "/beacon/beacon-basic-formdataMax.html", + { + "timeout": "long" + } + ] + ], + "beacon/beacon-basic-string.html": [ + [ + "/beacon/beacon-basic-string.html", + { + "timeout": "long" + } + ] + ], + "beacon/beacon-basic-stringMax.html": [ + [ + "/beacon/beacon-basic-stringMax.html", + { + "timeout": "long" + } + ] + ], + "beacon/beacon-cors.sub.window.js": [ + [ + "/beacon/beacon-cors.sub.window.html", + {} + ] + ], + "beacon/beacon-error.window.js": [ + [ + "/beacon/beacon-error.window.html", + {} + ] + ], + "beacon/beacon-navigate.html": [ + [ + "/beacon/beacon-navigate.html", + { + "timeout": "long" + } + ] + ], + "beacon/beacon-redirect.window.js": [ + [ + "/beacon/beacon-redirect.window.html", + {} + ] + ], "beacon/headers/header-content-type.html": [ [ "/beacon/headers/header-content-type.html", @@ -139089,6 +139242,12 @@ {} ] ], + "domparsing/innerhtml-mxss.sub.html": [ + [ + "/domparsing/innerhtml-mxss.sub.html", + {} + ] + ], "domparsing/insert-adjacent.html": [ [ "/domparsing/insert-adjacent.html", @@ -162731,6 +162890,12 @@ {} ] ], + "payment-request/payment-request-ctor-pmi-handling.https.html": [ + [ + "/payment-request/payment-request-ctor-pmi-handling.https.html", + {} + ] + ], "payment-request/payment-request-id.https.html": [ [ "/payment-request/payment-request-id.https.html", @@ -178837,6 +179002,12 @@ {} ] ], + "webvtt/api/VTTRegion/id.html": [ + [ + "/webvtt/api/VTTRegion/id.html", + {} + ] + ], "webvtt/api/VTTRegion/lines.html": [ [ "/webvtt/api/VTTRegion/lines.html", @@ -191294,6 +191465,10 @@ "ff051032814b1242f527970edc58675e3e14fb98", "testharness" ], + "XMLHttpRequest/access-control-basic-allow-access-control-origin-header-data-url.htm": [ + "6693ba20a5241c7ab0261669cf24082a0a7c4e2f", + "testharness" + ], "XMLHttpRequest/access-control-basic-allow-access-control-origin-header.htm": [ "88aa693115ee05b05adea5273bdfab501b167a60", "testharness" @@ -191310,6 +191485,10 @@ "782aca237c5d30a3a6ba2ee9be4824e01446e411", "testharness" ], + "XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm": [ + "84567f027ffcff9f5a1ed9c17b984f5835d5882b", + "testharness" + ], "XMLHttpRequest/access-control-basic-allow-star.htm": [ "694f8b8d67002e7b27d98ea2eb32f27fee311cad", "testharness" @@ -191318,6 +191497,10 @@ "8c2f2df46c8086f657806f763e68d775e1294bd0", "testharness" ], + "XMLHttpRequest/access-control-basic-denied.htm": [ + "890170b5b2857a6e837ea3ed0dc4692e206a864a", + "testharness" + ], "XMLHttpRequest/allow-lists-starting-with-comma.htm": [ "5e7870a6d66c475c2f96fd64a146ea751b08f4b1", "testharness" @@ -191730,10 +191913,18 @@ "b7351f59af91646549075b6b732eeb6c750e3faf", "support" ], + "XMLHttpRequest/resources/access-control-basic-denied.py": [ + "f34648df5e659fdafca55dd036f2feca2451d13e", + "support" + ], "XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py": [ "5b043f99d8f9d3f1c253324447df2d0586bf735a", "support" ], + "XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py": [ + "4e205534cff698089c017cd3f959f74862f3870a", + "support" + ], "XMLHttpRequest/resources/access-control-origin-header.py": [ "529883eed380c4505c1ddbc87ae5885254756626", "support" @@ -192746,6 +192937,66 @@ "61b61d09a21daee964e0ebd26f7bdfdd1964c8ae", "support" ], + "beacon/beacon-basic-blob-expected.txt": [ + "54002e53a22f33ab12765a0342590d2ab557cc6c", + "support" + ], + "beacon/beacon-basic-blob.html": [ + "60262cdcf9a58117db70f2afdeed195c820b04c7", + "testharness" + ], + "beacon/beacon-basic-blobMax-expected.txt": [ + "7252dd8292fdb2d5c3aa0e97c59e1a25661a70fd", + "support" + ], + "beacon/beacon-basic-blobMax.html": [ + "fc22daa6ecfd30f94452f32250876709ceb0de64", + "testharness" + ], + "beacon/beacon-basic-buffersource.html": [ + "d5b79f5174e0d7d086e72cf8c2ae5b2ccbdc9dcb", + "testharness" + ], + "beacon/beacon-basic-buffersourceMax.html": [ + "1705d1ce9ca7e8ada8e143c404546b2b29f581fd", + "testharness" + ], + "beacon/beacon-basic-formdata.html": [ + "6157608b53dfe533307141d531fcfd9ac6acca9f", + "testharness" + ], + "beacon/beacon-basic-formdataMax.html": [ + "cd00ed52c24c8e7106d662594f5fafa0d48b37d4", + "testharness" + ], + "beacon/beacon-basic-string.html": [ + "d1bbdd45e304aee9e5a2ac462ca5fb95397e0c0c", + "testharness" + ], + "beacon/beacon-basic-stringMax.html": [ + "a02beda7ba6c743a1e104068ff9259c5c8741096", + "testharness" + ], + "beacon/beacon-common.sub.js": [ + "75bee9ae7588c181a9a4f3eb9bced109a0190bfc", + "support" + ], + "beacon/beacon-cors.sub.window.js": [ + "1821072ced64052cea6d2fc3ccb73cfe23a4235e", + "testharness" + ], + "beacon/beacon-error.window.js": [ + "3e78d3aba0964c79965c83727bb2a73381382a2e", + "testharness" + ], + "beacon/beacon-navigate.html": [ + "88999e7d123854f9e40411365b58da15d7d651a0", + "testharness" + ], + "beacon/beacon-redirect.window.js": [ + "8c75ccdace165cfc3697797b571c3d5ca79ac6a4", + "testharness" + ], "beacon/headers/header-content-type-expected.txt": [ "cfce1555852fb39dee45de50c96d2510d7c99267", "support" @@ -192806,6 +193057,14 @@ "8185d2b31fbf67a573444d3c8f828f96422526f5", "support" ], + "beacon/navigate.iFrame.sub.html": [ + "03a7f2477d3efef7572b1c45a6ed113350aec948", + "support" + ], + "beacon/resources/beacon.py": [ + "12c892f085e2498f4c4abfda2409c61b0243a27f", + "support" + ], "beacon/resources/content-type.py": [ "0734a043b92b0a2646d643f14c0e7e0e33043b1d", "support" @@ -241994,6 +242253,10 @@ "b420f01bdc20c9acd0787767f32a32e89224d755", "testharness" ], + "domparsing/innerhtml-mxss.sub.html": [ + "c85fb326dcab0bd83ac1e2264747642c1e4b2b82", + "testharness" + ], "domparsing/insert-adjacent.html": [ "e5e03abc181a33da94810491d77060922b905d1a", "testharness" @@ -246115,7 +246378,7 @@ "support" ], "html-media-capture/idlharness.html": [ - "32b3d387100f0e7ecda93d1fb88351680b259df0", + "d6f14981f18dda4e5720cf3e9bf4d4724746664d", "testharness" ], "html-media-capture/support/upload.txt": [ @@ -271663,7 +271926,7 @@ "testharness" ], "payment-request/payment-request-constructor-crash.https-expected.txt": [ - "512bd82206386b526dea470b2e5ecd0849f52b89", + "24fef5a56ed4e67efbca5ef18a0d5a091344116f", "support" ], "payment-request/payment-request-constructor-crash.https.html": [ @@ -271671,11 +271934,11 @@ "testharness" ], "payment-request/payment-request-constructor.https-expected.txt": [ - "9fa0617664c7c2d940c0a4876c3a6c68d8fb0c5c", + "e3fdae9818352db791aa7916541792197cdd91a0", "support" ], "payment-request/payment-request-constructor.https.html": [ - "847cc78f52dc5696886eedc77b2969a562caf74f", + "7690d1931eac63274286fee76a993522bf6ad717", "testharness" ], "payment-request/payment-request-ctor-currency-code-checks.https-expected.txt": [ @@ -271686,6 +271949,14 @@ "7efdfa3457fff90fc3f66054505dcf7a7ff4645b", "testharness" ], + "payment-request/payment-request-ctor-pmi-handling.https-expected.txt": [ + "0ce75e14dd2bd471dc0a169593879672a3c69f05", + "support" + ], + "payment-request/payment-request-ctor-pmi-handling.https.html": [ + "9582172cb0d7e771cf836f3322dbb2c8fc913565", + "testharness" + ], "payment-request/payment-request-id.https-expected.txt": [ "8ec446f54d3bb82d475dfa4c04add39c439d4ec6", "support" @@ -288610,6 +288881,14 @@ "0ee58bc32daf656ddc1c8ea6eec84f487b2bf010", "testharness" ], + "webvtt/api/VTTRegion/id-expected.txt": [ + "7c1be1c906610e403d14fcc6ba17cd46fd9fe517", + "support" + ], + "webvtt/api/VTTRegion/id.html": [ + "6f289f2de147d93146160c249babc23f4f800494", + "testharness" + ], "webvtt/api/VTTRegion/lines.html": [ "590cec0b814df0bca2760cde94b2f74b4c9defca", "testharness" @@ -288643,11 +288922,11 @@ "support" ], "webvtt/api/interfaces-expected.txt": [ - "0293abe70348da9529ff369121f3e10064bbd88d", + "80bbd29064be0867a2e0c43372b15466644d3f06", "support" ], "webvtt/api/interfaces.html": [ - "dbff06876d1a0db46505423b9c1d919c2188b7a9", + "8e40a10fa7bcbfeeb52c01e9d74e09ca5bbc215e", "testharness" ], "webvtt/categories.json": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blob-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blob-expected.txt new file mode 100644 index 0000000..00fd0eb9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blob-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +FAIL Verify 'navigator.sendbeacon()' successfully sends for variant: EmptyBlob Failed to execute 'sendBeacon' on 'Navigator': sendBeacon() with a Blob whose type is not any of the CORS-safelisted values for the Content-Type request header is disabled temporarily. See http://crbug.com/490015 for details. +FAIL Verify 'navigator.sendbeacon()' successfully sends for variant: SmallBlob Failed to execute 'sendBeacon' on 'Navigator': sendBeacon() with a Blob whose type is not any of the CORS-safelisted values for the Content-Type request header is disabled temporarily. See http://crbug.com/490015 for details. +FAIL Verify 'navigator.sendbeacon()' successfully sends for variant: MediumBlob Failed to execute 'sendBeacon' on 'Navigator': sendBeacon() with a Blob whose type is not any of the CORS-safelisted values for the Content-Type request header is disabled temporarily. See http://crbug.com/490015 for details. +FAIL Verify 'navigator.sendbeacon()' successfully sends for variant: LargeBlob Failed to execute 'sendBeacon' on 'Navigator': sendBeacon() with a Blob whose type is not any of the CORS-safelisted values for the Content-Type request header is disabled temporarily. See http://crbug.com/490015 for details. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blob.html b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blob.html new file mode 100644 index 0000000..805ea63 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blob.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> + <title>W3C Beacon Basic Blob Test</title> + <meta name="timeout" content="long"> + <meta name="author" title="Microsoft Edge" href="https://www.microsoft.com"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script src="/common/utils.js"></script> + <script src="beacon-common.sub.js"></script> + <script> + "use strict"; + runTests(blobTests); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blobMax-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blobMax-expected.txt new file mode 100644 index 0000000..66c55f6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blobMax-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Verify 'navigator.sendbeacon()' successfully sends for variant: MaxBlob Failed to execute 'sendBeacon' on 'Navigator': sendBeacon() with a Blob whose type is not any of the CORS-safelisted values for the Content-Type request header is disabled temporarily. See http://crbug.com/490015 for details. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blobMax.html b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blobMax.html new file mode 100644 index 0000000..e18b163 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-blobMax.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> + <title>W3C Beacon Basic Blob Test - MaxSize</title> + <meta name="timeout" content="long"> + <meta name="author" title="Microsoft Edge" href="https://www.microsoft.com"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script src="/common/utils.js"></script> + <script src="beacon-common.sub.js"></script> + <script> + "use strict"; + runTests(blobMaxTest); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-buffersource.html b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-buffersource.html new file mode 100644 index 0000000..14c7a4f3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-buffersource.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> + <title>W3C Beacon Basic BufferSource Test</title> + <meta name="timeout" content="long"> + <meta name="author" title="Microsoft Edge" href="https://www.microsoft.com"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script src="/common/utils.js"></script> + <script src="beacon-common.sub.js"></script> + <script> + "use strict"; + runTests(bufferSourceTests); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-buffersourceMax.html b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-buffersourceMax.html new file mode 100644 index 0000000..5163ecd --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-buffersourceMax.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> + <title>W3C Beacon Basic BufferSource Test - MaxSize</title> + <meta name="timeout" content="long"> + <meta name="author" title="Microsoft Edge" href="https://www.microsoft.com"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script src="/common/utils.js"></script> + <script src="beacon-common.sub.js"></script> + <script> + "use strict"; + runTests(bufferSourceMaxTest); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-formdata.html b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-formdata.html new file mode 100644 index 0000000..9f46cf6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-formdata.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> + <title>W3C Beacon Basic FormData Test</title> + <meta name="timeout" content="long"> + <meta name="author" title="Microsoft Edge" href="https://www.microsoft.com"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script src="/common/utils.js"></script> + <script src="beacon-common.sub.js"></script> + <script> + "use strict"; + runTests(formDataTests); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-formdataMax.html b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-formdataMax.html new file mode 100644 index 0000000..2c7e0fa --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-formdataMax.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> + <title>W3C Beacon Basic FormData Test</title> + <meta name="timeout" content="long"> + <meta name="author" title="Microsoft Edge" href="https://www.microsoft.com"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script src="/common/utils.js"></script> + <script src="beacon-common.sub.js"></script> + <script> + "use strict"; + runTests(formDataMaxTest); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-string.html b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-string.html new file mode 100644 index 0000000..cba65da --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-string.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> + <title>W3C Beacon Basic String Test</title> + <meta name="timeout" content="long"> + <meta name="author" title="Microsoft Edge" href="https://www.microsoft.com"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script src="/common/utils.js"></script> + <script src="beacon-common.sub.js"></script> + <script> + "use strict"; + runTests(stringTests); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-stringMax.html b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-stringMax.html new file mode 100644 index 0000000..005e9f5c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-basic-stringMax.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> + <title>W3C Beacon Basic String Test - MaxSize</title> + <meta name="timeout" content="long"> + <meta name="author" title="Microsoft Edge" href="https://www.microsoft.com"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script src="/common/utils.js"></script> + <script src="beacon-common.sub.js"></script> + <script> + "use strict"; + runTests(stringMaxTest); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-common.sub.js b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-common.sub.js new file mode 100644 index 0000000..de3846b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-common.sub.js
@@ -0,0 +1,354 @@ +"use strict"; + +// Different sizes of payloads to test. +var smallPayloadSize = 10; +var mediumPayloadSize = 10000; +var largePayloadSize = 50000; +var maxPayloadSize = 65536; // The maximum payload size allowed for a beacon request. + +// String payloads of various sizes sent by sendbeacon. The format of the payloads is a string: +// <numberOfCharacters>:<numberOfCharacters *'s> +// ex. "10:**********" +var smallPayload = smallPayloadSize + ":" + Array(smallPayloadSize).fill('*').join(""); +var mediumPayload = mediumPayloadSize + ":" + Array(mediumPayloadSize).fill('*').join(""); +var largePayload = largePayloadSize + ":" + Array(largePayloadSize).fill('*').join(""); +// Subtract 6 from maxPayloadSize because 65536 is 5 digits, plus 1 more for the ':' +var maxPayload = (maxPayloadSize - 6) + ":" + Array(maxPayloadSize - 6).fill('*').join("") + +// Test case definitions. +// id: String containing the unique name of the test case. +// data: Payload object to send through sendbeacon. +var noDataTest = { id: "NoData" }; +var nullDataTest = { id: "NullData", data: null }; +var undefinedDataTest = { id: "UndefinedData", data: undefined }; +var smallStringTest = { id: "SmallString", data: smallPayload }; +var mediumStringTest = { id: "MediumString", data: mediumPayload }; +var largeStringTest = { id: "LargeString", data: largePayload }; +var maxStringTest = { id: "MaxString", data: maxPayload }; +var emptyBlobTest = { id: "EmptyBlob", data: new Blob() }; +var smallBlobTest = { id: "SmallBlob", data: new Blob([smallPayload]) }; +var mediumBlobTest = { id: "MediumBlob", data: new Blob([mediumPayload]) }; +var largeBlobTest = { id: "LargeBlob", data: new Blob([largePayload]) }; +var maxBlobTest = { id: "MaxBlob", data: new Blob([maxPayload]) }; +var emptyBufferSourceTest = { id: "EmptyBufferSource", data: new Uint8Array() }; +var smallBufferSourceTest = { id: "SmallBufferSource", data: CreateArrayBufferFromPayload(smallPayload) }; +var mediumBufferSourceTest = { id: "MediumBufferSource", data: CreateArrayBufferFromPayload(mediumPayload) }; +var largeBufferSourceTest = { id: "LargeBufferSource", data: CreateArrayBufferFromPayload(largePayload) }; +var maxBufferSourceTest = { id: "MaxBufferSource", data: CreateArrayBufferFromPayload(maxPayload) }; +var emptyFormDataTest = { id: "EmptyFormData", data: CreateEmptyFormDataPayload() }; +var smallFormDataTest = { id: "SmallFormData", data: CreateFormDataFromPayload(smallPayload) }; +var mediumFormDataTest = { id: "MediumFormData", data: CreateFormDataFromPayload(mediumPayload) }; +var largeFormDataTest = { id: "LargeFormData", data: CreateFormDataFromPayload(largePayload) }; +// We don't test maxFormData because the extra multipart separators make it difficult to +// calculate a maxPayload. + +// Test case suites. +// Due to quota limits we split the max payload tests into their own bucket. +var stringTests = [noDataTest, nullDataTest, undefinedDataTest, smallStringTest, mediumStringTest, largeStringTest]; +var stringMaxTest = [maxStringTest]; +var blobTests = [emptyBlobTest, smallBlobTest, mediumBlobTest, largeBlobTest]; +var blobMaxTest = [maxBlobTest]; +var bufferSourceTests = [emptyBufferSourceTest, smallBufferSourceTest, mediumBufferSourceTest, largeBufferSourceTest]; +var bufferSourceMaxTest = [maxBufferSourceTest]; +var formDataTests = [emptyFormDataTest, smallFormDataTest, mediumFormDataTest, largeFormDataTest]; +var formDataMaxTest = [largeFormDataTest]; +var allTests = [].concat(stringTests, stringMaxTest, blobTests, blobMaxTest, bufferSourceTests, bufferSourceMaxTest, formDataTests, formDataMaxTest); + +// This special cross section of test cases is meant to provide a slimmer but reasonably- +// representative set of tests for parameterization across variables (e.g. redirect codes, +// cors modes, etc.) +var sampleTests = [noDataTest, nullDataTest, undefinedDataTest, smallStringTest, smallBlobTest, smallBufferSourceTest, smallFormDataTest]; + +// Build a test lookup table, which is useful when instructing a web worker or an iframe +// to run a test, so that we don't have to marshal the entire test case across a process boundary. +var testLookup = {}; +allTests.forEach(function(testCase) { + testLookup[testCase.id] = testCase; +}); + +// Helper function to create an ArrayBuffer representation of a string. +function CreateArrayBufferFromPayload(payload) { + var length = payload.length; + var buffer = new Uint8Array(length); + + for (var i = 0; i < length; i++) { + buffer[i] = payload.charCodeAt(i); + } + + return buffer; +} + +// Helper function to create an empty FormData object. +function CreateEmptyFormDataPayload() { + if (self.document === undefined) { + return null; + } + + return new FormData(); +} + +// Helper function to create a FormData representation of a string. +function CreateFormDataFromPayload(payload) { + if (self.document === undefined) { + return null; + } + + var formData = new FormData(); + formData.append("payload", payload); + return formData; +} + +// Initializes a session with a client-generated SID. +// A "session" is a run of one or more tests. It is used to batch several beacon +// tests in a way that isolates the server-side session state and makes it easy +// to poll the results of the tests in one request. +// testCases: The array of test cases participating in the session. +function initSession(testCases) { + return { + // Provides a unique session identifier to prevent mixing server-side data + // with other sessions. + id: self.token(), + // Dictionary of test name to live testCase object. + testCaseLookup: {}, + // Array of testCase objects for iteration. + testCases: [], + // Tracks the total number of tests in the session. + totalCount: testCases.length, + // Tracks the number of tests for which we have sent the beacon. + // When it reaches totalCount, we will start polling for results. + sentCount: 0, + // Tracks the number of tests for which we have verified the results. + // When it reaches sentCount, we will stop polling for results. + doneCount: 0, + // Helper to add a testCase to the session. + add: function add(testCase) { + this.testCases.push(testCase); + this.testCaseLookup[testCase.id] = testCase; + } + }; +} + +// Schedules async_test's for each of the test cases, treating them as a single session, +// and wires up the continueAfterSendingBeacon() and waitForResults() calls. +// The method looks for several "extension" functions in the global scope: +// - self.buildId: if present, can change the display name of a test. +// - self.buildBaseUrl: if present, can change the base URL of a beacon target URL (this +// is the scheme, hostname, and port). +// - self.buildTargetUrl: if present, can modify a beacon target URL (for example wrap it). +// Parameters: +// testCases: An array of test cases. +function runTests(testCases) { + var session = initSession(testCases); + + testCases.forEach(function(testCase, testIndex) { + // Make a copy of the test case as we'll be storing some metadata on it, + // such as which session it belongs to. + var testCaseCopy = Object.assign({ session: session }, testCase); + + // Extension point: generate the test id. + var testId = testCase.id; + if (self.buildId) { + testId = self.buildId(testId); + } + testCaseCopy.origId = testCaseCopy.id; + testCaseCopy.id = testId; + testCaseCopy.index = testIndex; + + session.add(testCaseCopy); + + // Schedule the sendbeacon in an async test. + async_test(function(test) { + // Save the testharness.js 'test' object, so that we only have one object + // to pass around. + testCaseCopy.test = test; + + // Extension point: generate the beacon URL. + var baseUrl = "http://{{host}}:{{ports[http][0]}}"; + if (self.buildBaseUrl) { + baseUrl = self.buildBaseUrl(baseUrl); + } + var targetUrl = `${baseUrl}/beacon/resources/beacon.py?cmd=store&sid=${session.id}&tid=${testId}&tidx=${testIndex}`; + if (self.buildTargetUrl) { + targetUrl = self.buildTargetUrl(targetUrl); + } + // Attach the URL to the test object for debugging purposes. + testCaseCopy.url = targetUrl; + + // Extension point: send the beacon immediately, or defer. + var sendFunc = test.step_func(function sendImmediately(testCase) { + var sendResult = sendData(testCase); + continueAfterSendingBeacon(sendResult, testCase); + }); + if (self.sendFunc) { + sendFunc = test.step_func(self.sendFunc); + } + sendFunc(testCaseCopy); + }, `Verify 'navigator.sendbeacon()' successfully sends for variant: ${testCaseCopy.id}`); + }); +} + +// Sends the beacon for a single test. This step is factored into its own function so that +// it can be called from a web worker. It does not check for results. +// Note: do not assert from this method, as when called from a worker, we won't have the +// full testharness.js test context. Instead return 'false', and the main scope will fail +// the test. +// Returns the result of the 'sendbeacon()' function call, true or false. +function sendData(testCase) { + var sent = false; + if (testCase.data) { + sent = self.navigator.sendBeacon(testCase.url, testCase.data); + } else { + sent = self.navigator.sendBeacon(testCase.url) + } + return sent; +} + +// Continues a single test after the beacon has been sent for that test. +// Will trigger waitForResults() for the session if this is the last test +// in the session to send its beacon. +// Assumption: will be called on the test's step_func so that assert's do +// not have to be wrapped. +function continueAfterSendingBeacon(sendResult, testCase) { + var session = testCase.session; + + // Recaclulate the sent vs. total counts. + if (sendResult) { + session.sentCount++; + } else { + session.totalCount--; + } + + // If this was the last test in the session to send its beacon, start polling for results. + // Note that we start polling even if just one test in the session sends successfully, + // so that if any of the others fail, we still get results from the tests that did send. + if (session.sentCount == session.totalCount) { + // Exit the current test's execution context in order to run the poll + // loop from the harness context. + step_timeout(waitForResults.bind(this, session), 0); + } + + // Now fail this test if the beacon did not send. It will be excluded from the poll + // loop because of the calculation adjustment above. + assert_true(sendResult, "'sendbeacon' function call must succeed"); +} + +// Kicks off an asynchronous monitor to poll the server for test results. As we +// verify that the server has received and validated a beacon, we will complete +// its testharness test. +function waitForResults(session) { + // Poll for status until all of the results come in. + fetch(`resources/beacon.py?cmd=stat&sid=${session.id}&tidx_min=0&tidx_max=${session.totalCount-1}`).then( + function(response) { + // Parse as text(), not json(), so that we can log the raw response if + // it's invalid. + response.text().then(function(rawResponse) { + // Check that we got a response we expect and know how to handle. + var results; + var failure; + try { + results = JSON.parse(rawResponse); + + if (results.length === undefined) { + failure = `bad validation response schema: rawResponse='${rawResponse}'`; + } + } catch (e) { + failure = `bad validation response: rawResponse='${rawResponse}', got parse error '${e}'`; + } + + if (failure) { + // At this point we can't deterministically get results for all of the + // tests in the session, so fail the entire session. + failSession(session, failure); + return; + } + + // The 'stat' call will return an array of zero or more results + // of sendbeacon() calls that the server has received and validated. + results.forEach(function(result) { + var testCase = session.testCaseLookup[result.id]; + + // While stash.take on the server is supposed to honor read-once, since we're + // polling so frequently it is possible that we will receive the same test result + // more than once. + if (!testCase.done) { + testCase.done = true; + session.doneCount++; + } + + // Validate that the sendbeacon() was actually sent to the server. + var test = testCase.test; + test.step(function() { + // null JSON values parse as null, not undefined + assert_equals(result.error, null, "'sendbeacon' data must not fail validation"); + }); + + test.done(); + }); + + // Continue polling until all of the results come in. + if (session.doneCount < session.sentCount) { + // testharness.js frowns upon the use of explicit timeouts, but there is no way + // around the need to poll for these tests, and there is no use spamming the server + // with requestAnimationFrame() just to avoid the use of step_timeout. + step_timeout(waitForResults.bind(this, session), 100); + } + }).catch(function(error) { + failSession(session, `unexpected error reading response, error='${error}'`); + }); + } + ); +} + +// Fails all of the tests in the session, meant to be called when an infrastructural +// issue prevents us from deterministically completing the individual tests. +function failSession(session, reason) { + session.testCases.forEach(function(testCase) { + var test = testCase.test; + test.unreached_func(reason)(); + }); +} + +// Creates an iframe on the document's body and runs the sample tests from the iframe. +// The iframe is navigated immediately after it sends the data, and the window verifies +// that the data is still successfully sent. +// funcName: "beacon" to send the data via navigator.sendBeacon(), +// "fetch" to send the data via fetch() with the keepalive flag. +function runSendInIframeAndNavigateTests(funcName) { + var iframe = document.createElement("iframe"); + iframe.id = "iframe"; + iframe.onload = function() { + var tests = Array(); + + // Clear our onload handler to prevent re-running the tests as we navigate away. + this.onload = null; + + // Implement the self.buildId extension to identify the parameterized + // test in the report. + self.buildId = function(baseId) { + return `${baseId}-${funcName}-NAVIGATE`; + }; + + window.onmessage = function(e) { + // The iframe will execute sendData() for us and return the result. + var testCase = tests[e.data]; + continueAfterSendingBeacon(true /* sendResult */, testCase); + }; + + // Implement the self.sendFunc extension to send the beacon indirectly, + // from an iFrame that we can then navigate. + self.sendFunc = function(testCase) { + var iframeWindow = document.getElementById("iframe").contentWindow; + // We run into problems passing the testCase over the document boundary, + // because of structured cloning constraints. Instead we'll send over the + // test case id, and the iFrame can load the static test case by including + // beacon-common.js. + tests[testCase.origId] = testCase; + iframeWindow.postMessage([testCase.origId, testCase.url, funcName], "*"); + }; + + runTests(sampleTests); + }; + + iframe.src = "navigate.iFrame.sub.html"; + document.body.appendChild(iframe); +}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-cors.sub.window.js b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-cors.sub.window.js new file mode 100644 index 0000000..ddfdfbf --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-cors.sub.window.js
@@ -0,0 +1,41 @@ +// META: script=/common/utils.js +// META: script=beacon-common.sub.js + +"use strict"; + +// Execute each sample test with a cross-origin URL. If allowCors is 'true' +// the beacon handler will return CORS headers. This test ensures that the +// sendBeacon() succeeds in either case. +[true, false].forEach(function(allowCors) { + // Implement the self.buildId extension to identify the parameterized + // test in the report. + self.buildId = function(baseId) { + return `${baseId}-${allowCors ? "CORS-ALLOW" : "CORS-FORBID"}`; + }; + + // Implement the self.buildBaseUrl and self.buildTargetUrl extensions + // to change the target URL to use a cross-origin domain name. + self.buildBaseUrl = function(baseUrl) { + return "http://{{domains[www]}}:{{ports[http][0]}}"; + }; + // Implement the self.buildTargetUrl extension to append a directive + // to the handler, that it should return CORS headers, if 'allowCors' + // is true. + self.buildTargetUrl = function(targetUrl) { + // Note that 'allowCors=true' is not necessary for the sendBeacon() to reach + // the server. Beacons use the HTTP POST method, which is a CORS-safelisted + // method, and thus they do not trigger preflight. If the server does not + // respond with Access-Control-Allow-Origin and Access-Control-Allow-Credentials + // headers, an error will be printed to the console, but the request will + // already have reached the server. Since beacons are fire-and-forget, the + // error will not affect any client script, either -- not even the return + // value of the sendBeacon() call, because the underlying fetch is asynchronous. + // The "Beacon CORS" tests are merely testing that sendBeacon() to a cross- + // origin URL *will* work regardless. + return allowCors ? `${targetUrl}&origin=http://{{host}}:{{ports[http][0]}}&credentials=true` : targetUrl; + } + + runTests(sampleTests); +}); + +done(); \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-error.window.js b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-error.window.js new file mode 100644 index 0000000..9c037ba --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-error.window.js
@@ -0,0 +1,39 @@ +// META: script=/common/utils.js +// META: script=beacon-common.sub.js + +"use strict"; + +test(function() { + // Payload that should cause sendBeacon to return false because it exceeds the maximum payload size. + var exceedPayload = Array(maxPayloadSize + 1).fill('z').join(""); + + var success = navigator.sendBeacon("http://doesnotmatter", exceedPayload); + assert_false(success, "calling 'navigator.sendBeacon()' with payload size exceeding the maximum size must fail"); +}, "Verify calling 'navigator.sendBeacon()' with a large payload returns 'false'."); + +test(function() { + var invalidUrl = "http://invalid:url"; + assert_throws(new TypeError(), function() { navigator.sendBeacon(invalidUrl, smallPayload); }, + `calling 'navigator.sendBeacon()' with an invalid URL '${invalidUrl}' must throw a TypeError`); +}, "Verify calling 'navigator.sendBeacon()' with an invalid URL throws an exception."); + +test(function() { + var invalidUrl = "nothttp://invalid.url"; + assert_throws(new TypeError(), function() { navigator.sendBeacon(invalidUrl, smallPayload); }, + `calling 'navigator.sendBeacon()' with a non-http(s) URL '${invalidUrl}' must throw a TypeError`); +}, "Verify calling 'navigator.sendBeacon()' with a URL that is not a http(s) scheme throws an exception."); + +// We'll validate that we can send one beacon that uses our entire Quota and then fail to send one that is just one char. +test(function () { + var destinationURL = "/fetch/api/resources/trickle.py?count=1&ms=1000"; + + var firstSuccess = navigator.sendBeacon(destinationURL, maxPayload); + assert_true(firstSuccess, "calling 'navigator.sendBeacon()' with our max payload size should succeed."); + + // Now we'll send just one character. + var secondSuccess = navigator.sendBeacon(destinationURL, "1"); + assert_false(secondSuccess, "calling 'navigator.sendBeacon()' with just one char should fail while our Quota is used up."); + +}, "Verify calling 'navigator.sendBeacon()' with a small payload fails while Quota is completely utilized."); + +done();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-navigate.html b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-navigate.html new file mode 100644 index 0000000..5df13905 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-navigate.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> + <title>W3C Beacon Outliving Navigation Test</title> + <meta name="timeout" content="long"> + <meta name="author" title="Microsoft Edge" href="https://www.microsoft.com"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script src="/common/utils.js"></script> + <script src="beacon-common.sub.js"></script> + <script> + "use strict"; + + runSendInIframeAndNavigateTests("beacon"); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-redirect.window.js b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-redirect.window.js new file mode 100644 index 0000000..659759b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/beacon-redirect.window.js
@@ -0,0 +1,25 @@ +// META: script=/common/utils.js +// META: script=beacon-common.sub.js + +"use strict"; + +// Execute each sample test per redirect status code. +// Note that status codes 307 and 308 are the only codes that will maintain POST data +// through a redirect. +[307, 308].forEach(function(status) { + // Implement the self.buildId extension to identify the parameterized + // test in the report. + self.buildId = function(baseId) { + return `${baseId}-${status}`; + }; + + // Implement the self.buildTargetUrl extension to inject a redirect to + // the sendBeacon target. + self.buildTargetUrl = function(targetUrl) { + return `/common/redirect.py?status=${status}&location=${encodeURIComponent(targetUrl)}`; + }; + + runTests(sampleTests); +}); + +done();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/navigate.iFrame.sub.html b/third_party/WebKit/LayoutTests/external/wpt/beacon/navigate.iFrame.sub.html new file mode 100644 index 0000000..f4c7846 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/navigate.iFrame.sub.html
@@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> +<head> + <title>W3C Beacon As Fetch (Fetch KeepAlive) Navigate Test</title> +</head> +<body> + <script src="beacon-common.sub.js"></script> + <script> + "use strict"; + + // An array should be passed through postMessage to this iFrame, where + // [0] contains a test case id as defined in beacon-common.js. + // [1] is the URL for the keep alive fetch() or sendBeacon(). + // [2] string indicating the function to call - "fetch" to call fetch() or "beacon" to call sendBeacon(). + // The testcase id is returned back to the window through postMesage. + var tests = 0; + window.onmessage = function(e) { + var testCaseId = e.data[0]; + var url = e.data[1]; + var func = e.data[2]; + tests++; + + // Reconstruct enough of the test case to send the keep alive fetch (data and url). + var testCase = testLookup[testCaseId]; + testCase.url = url; + + if (func === "beacon") { + // sendData calls sendBeacon + sendData(testCase); + } + else { + throw new Error(func + " is an invalid function"); + } + + // Let the main page continue the test if we don't immediately throw an exception. + parent.postMessage(testCaseId, "*"); + + // Now navigate ourselves. + if (tests == sampleTests.length) { + window.location = "http://{{host}}:{{ports[http][0]}}/"; + } + } + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/beacon/resources/beacon.py b/third_party/WebKit/LayoutTests/external/wpt/beacon/resources/beacon.py new file mode 100644 index 0000000..afa522a2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/beacon/resources/beacon.py
@@ -0,0 +1,112 @@ +import json + +def build_stash_key(session_id, test_num): + return "%s_%s" % (session_id, test_num) + +def main(request, response): + """Helper handler for Beacon tests. + + It handles two forms of requests: + + STORE: + A URL with a query string of the form 'cmd=store&sid=<token>&tidx=<test_index>&tid=<test_name>'. + + Stores the receipt of a sendBeacon() request along with its validation result, returning HTTP 200 OK. + + Parameters: + tidx - the integer index of the test. + tid - a friendly identifier or name for the test, used when returning results. + + STAT: + A URL with a query string of the form 'cmd=stat&sid=<token>&tidx_min=<min_test_index>&tidx_max=<max_test_index>'. + + Retrieves the results of test with indices [min_test_index, max_test_index] and returns them as + a JSON array and HTTP 200 OK status code. Due to the eventual read-once nature of the stash, results for a given test + are only guaranteed to be returned once, though they may be returned multiple times. + + Parameters: + tidx_min - the lower-bounding integer test index. + tidx_max - the upper-bounding integer test index. + + Example response body: + [{"id": "Test1", error: null}, {"id": "Test2", error: "some validation details"}] + + Common parameters: + cmd - the command, 'store' or 'stat'. + sid - session id used to provide isolation to a test run comprising multiple sendBeacon() + tests. + """ + + session_id = request.GET.first("sid"); + command = request.GET.first("cmd").lower(); + + # Workaround to circumvent the limitation that cache keys + # can only be UUID's. + def wrap_key(key, path): + return (str(path), str(key)) + request.server.stash._wrap_key = wrap_key + + # Append CORS headers if needed. + if "origin" in request.GET: + response.headers.set("Access-Control-Allow-Origin", request.GET.first("origin")) + if "credentials" in request.GET: + response.headers.set("Access-Control-Allow-Credentials", request.GET.first("credentials")) + + # Handle the 'store' and 'stat' commands. + if command == "store": + # The test id is just used to make the results more human-readable. + test_id = request.GET.first("tid") + # The test index is used to build a predictable stash key, together + # with the unique session id, in order to retrieve a range of results + # later knowing the index range. + test_idx = request.GET.first("tidx") + + test_data_key = build_stash_key(session_id, test_idx) + test_data = { "id": test_id, "error": None } + + payload = "" + if "Content-Type" in request.headers and \ + "form-data" in request.headers["Content-Type"]: + if "payload" in request.POST: + # The payload was sent as a FormData. + payload = request.POST.first("payload") + else: + # A FormData was sent with an empty payload. + pass + else: + # The payload was sent as either a string, Blob, or BufferSource. + payload = request.body + + payload_parts = filter(None, payload.split(":")) + if len(payload_parts) > 0: + payload_size = int(payload_parts[0]) + + # Confirm the payload size sent matches with the number of characters sent. + if payload_size != len(payload_parts[1]): + test_data["error"] = "expected %d characters but got %d" % (payload_size, len(payload_parts[1])) + else: + # Confirm the payload contains the correct characters. + for i in range(0, payload_size): + if payload_parts[1][i] != "*": + test_data["error"] = "expected '*' at index %d but got '%s''" % (i, payload_parts[1][i]) + break + + # Store the result in the stash so that it can be retrieved + # later with a 'stat' command. + request.server.stash.put(test_data_key, test_data) + elif command == "stat": + test_idx_min = int(request.GET.first("tidx_min")) + test_idx_max = int(request.GET.first("tidx_max")) + + # For each result that has come in, append it to the response. + results = [] + for test_idx in range(test_idx_min, test_idx_max+1): # +1 because end is exclusive + test_data_key = build_stash_key(session_id, test_idx) + test_data = request.server.stash.take(test_data_key) + if test_data: + results.append(test_data) + + response.headers.set("Content-Type", "text/plain") + response.content = json.dumps(results) + else: + response.status = 400 # BadRequest \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/hidpi/device-pixel-ratio-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/hidpi/device-pixel-ratio-ref.html new file mode 100644 index 0000000..205cf89 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/hidpi/device-pixel-ratio-ref.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<style> +html, body { margin: 0; padding: 0; } +canvas {width: 150px; height: 150px; } +</style> +<body> +<p>This test ensures that the PaintWorkletGlobalScope.devicePixelRatio returns +the correct value, which should be identical as window.devicePixelRatio. To +manually test, open both this file and "device-pixel-ratio-ref.html" with a +browser, and you should see two idential green rectangles.</p> +<canvas id ="canvas" width="100" height="100"></canvas> +<script> +var canvas = document.getElementById('canvas'); +canvas.width = 150 * window.devicePixelRatio; +canvas.height = 150 * window.devicePixelRatio; +var context = canvas.getContext("2d"); +context.fillStyle = 'green'; +var draw_width = Math.floor(canvas.width / window.devicePixelRatio); +var draw_height = Math.floor(canvas.height / window.devicePixelRatio); +context.fillRect(0, 0, draw_width, draw_height); +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/hidpi/device-pixel-ratio.html b/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/hidpi/device-pixel-ratio.html new file mode 100644 index 0000000..fb62c23d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/hidpi/device-pixel-ratio.html
@@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<link rel="match" href="device-pixel-ratio-ref.html"> +<style> +html, body { margin: 0; padding: 0; } +.container { + width: 150px; + height: 150px; +} + +#canvas-geometry { + background-image: paint(geometry); +} +</style> +<script src="/common/reftest-wait.js"></script> +<script src="/common/css-paint-tests.js"></script> +<body> +<p>This test ensures that the PaintWorkletGlobalScope.devicePixelRatio returns +the correct value, which should be identical as window.devicePixelRatio. To +manually test, open both this file and "device-pixel-ratio-ref.html" with a +browser, and you should see two idential green rectangles.</p> +<div id="canvas-geometry" class="container"></div> + +<script id="code" type="text/worklet"> +registerPaint('geometry', class { + paint(ctx, geom) { + ctx.fillStyle = 'green'; + var draw_width = Math.floor(geom.width / devicePixelRatio); + var draw_height = Math.floor(geom.height / devicePixelRatio); + ctx.fillRect(0, 0, draw_width, draw_height); + } +}); +</script> + +<script> + importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('code').textContent); +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html-media-capture/idlharness.html b/third_party/WebKit/LayoutTests/external/wpt/html-media-capture/idlharness.html index 22b3e05e..93014f3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html-media-capture/idlharness.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html-media-capture/idlharness.html
@@ -25,11 +25,8 @@ <pre id='idl' style='display:none'> partial interface HTMLInputElement { - attribute CaptureFacingMode capture; - }; - enum CaptureFacingMode { - "user", - "environment" + [CEReactions] + attribute DOMString capture; }; </pre> @@ -39,12 +36,12 @@ <script> (function() { - var idl_array = new IdlArray(); + let idl_array = new IdlArray(); idl_array.add_untested_idls(document.getElementById('untested_idl').textContent); idl_array.add_idls(document.getElementById('idl').textContent); - var testElement = document.getElementById('testElement'); + let testElement = document.getElementById('testElement'); idl_array.add_objects({HTMLInputElement: [testElement]}); idl_array.test(); })();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-constructor.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-constructor.https-expected.txt index 3207c595..8e65654f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-constructor.https-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-constructor.https-expected.txt
@@ -5,7 +5,6 @@ FAIL Use ids even if they are strange Failed to construct 'PaymentRequest': The provided value cannot be converted to a sequence. FAIL Use provided request ID Failed to construct 'PaymentRequest': The provided value cannot be converted to a sequence. FAIL If the length of the methodData sequence is zero, then throw a TypeError Failed to construct 'PaymentRequest': The provided value cannot be converted to a sequence. -FAIL ignore invalid payment method URLs Failed to construct 'PaymentRequest': The provided value cannot be converted to a sequence. FAIL Modifier method data must be JSON-serializable object Failed to construct 'PaymentRequest': The provided value cannot be converted to a sequence. FAIL Rethrow any exceptions of JSON-serializing paymentMethod.data into a string Failed to construct 'PaymentRequest': The provided value cannot be converted to a sequence. FAIL If details.total.amount.value is not a valid decimal monetary value, then throw a TypeError Failed to construct 'PaymentRequest': The provided value cannot be converted to a sequence.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-constructor.https.html b/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-constructor.https.html index d400d7d..6c8e3df 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-constructor.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-constructor.https.html
@@ -89,36 +89,6 @@ test(() => { smokeTest(); - const invalidMethods = [ - { - supportedMethods: "http://username:password@example.com/pay", - }, - { - supportedMethods: "http://foo.com:100000000/pay", - }, - { - supportedMethods: "basic-💳", - }, - { - supportedMethods: "https://wpt.fyi/payment-request", - }, - { - supportedMethods: "¡basic-*-card!", - }, - ]; - for (const invalidMethod of invalidMethods) { - try { - new PaymentRequest([invalidMethod], defaultDetails); - } catch (err) { - assert_unreached( - `Unexpected error processing invalid PMI "${invalidMethod}". ${err.message}` - ); - } - } -}, "ignore invalid payment method URLs"); - -test(() => { - smokeTest(); const JSONSerializables = [[], { object: {} }]; for (const data of JSONSerializables) { try {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-ctor-pmi-handling.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-ctor-pmi-handling.https-expected.txt new file mode 100644 index 0000000..c185edcb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-ctor-pmi-handling.https-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Constructor MUST throw if given an invalid payment method identifier Failed to construct 'PaymentRequest': The provided value cannot be converted to a sequence. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-ctor-pmi-handling.https.html b/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-ctor-pmi-handling.https.html new file mode 100644 index 0000000..c9330c7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-ctor-pmi-handling.https.html
@@ -0,0 +1,64 @@ +<!DOCTYPE html> +<!-- Copyright © 2017 Mozilla and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). --> +<meta charset="utf-8"> +<title>Test for validity of payment method identifiers during construction</title> +<link rel="help" href="https://w3c.github.io/browser-payment-api/#constructor"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +"use strict"; +const testMethod = Object.freeze({ + supportedMethods: "https://wpt.fyi/payment-request", +}); +const defaultMethods = Object.freeze([testMethod]); +const defaultAmount = Object.freeze({ + currency: "USD", + value: "1.0", +}); +const defaultTotal = Object.freeze({ + label: "Default Total", + amount: defaultAmount, +}); +const defaultDetails = Object.freeze({ + total: defaultTotal, +}); + +// Avoid false positives, this should always pass +function smokeTest() { + new PaymentRequest(defaultMethods, defaultDetails); +} + +test(() => { + smokeTest(); + const invalidMethods = [ + { + supportedMethods: "http://username:password@example.com/pay", + }, + { + supportedMethods: "http://foo.com:100000000/pay", + }, + { + supportedMethods: "basic-💳", + }, + { + supportedMethods: "not-https://wpt.fyi/payment-request", + }, + { + supportedMethods: "¡basic-*-card!", + }, + { + supportedMethods: "Basic-Card", + }, + ]; + for (const invalidMethod of invalidMethods) { + assert_throws( + new RangeError(), + () => { + new PaymentRequest([invalidMethod], defaultDetails); + }, + `expected RangeError processing invalid PMI "${invalidMethod}"` + ); + } +}, "Constructor MUST throw if given an invalid payment method identifier"); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/VTTRegion/id-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/VTTRegion/id-expected.txt new file mode 100644 index 0000000..f78c5381 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/VTTRegion/id-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL VTTRegion.id script-created region assert_true: id is not supported expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/VTTRegion/id.html b/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/VTTRegion/id.html new file mode 100644 index 0000000..1eabac2d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/VTTRegion/id.html
@@ -0,0 +1,21 @@ +<!doctype html> +<title>VTTRegion.id</title> +<link rel="help" href="https://w3c.github.io/webvtt/#dom-vttregion-id"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div id=log></div> +<script> +test(function() { + var region = new VTTRegion(); + assert_true('id' in region, 'id is not supported'); + + assert_equals(region.id, '', 'initial value'); + + region.id = '1'; + assert_equals(region.id, '1', 'value after setting to "1"'); + + region.id = ''; + assert_equals(region.id, '', 'value after setting to the empty string'); + +}, document.title + ' script-created region'); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/interfaces-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/interfaces-expected.txt index ab25b95..e79e4a3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/interfaces-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/interfaces-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 50 tests; 46 PASS, 4 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 52 tests; 46 PASS, 6 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS VTTCue interface: existence and properties of interface object PASS VTTCue interface object length PASS VTTCue interface object name @@ -34,6 +34,7 @@ PASS VTTRegion interface object name PASS VTTRegion interface: existence and properties of interface prototype object PASS VTTRegion interface: existence and properties of interface prototype object's "constructor" property +FAIL VTTRegion interface: attribute id assert_true: The prototype object must have a property "id" expected true got false PASS VTTRegion interface: attribute width PASS VTTRegion interface: attribute lines PASS VTTRegion interface: attribute regionAnchorX @@ -43,6 +44,7 @@ PASS VTTRegion interface: attribute scroll PASS VTTRegion must be primary interface of new VTTRegion() PASS Stringification of new VTTRegion() +FAIL VTTRegion interface: new VTTRegion() must inherit property "id" with the proper type assert_inherits: property "id" not found in prototype chain PASS VTTRegion interface: new VTTRegion() must inherit property "width" with the proper type PASS VTTRegion interface: new VTTRegion() must inherit property "lines" with the proper type PASS VTTRegion interface: new VTTRegion() must inherit property "regionAnchorX" with the proper type
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/interfaces.html b/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/interfaces.html index d4565bb..5fb56625 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/interfaces.html +++ b/third_party/WebKit/LayoutTests/external/wpt/webvtt/api/interfaces.html
@@ -141,6 +141,7 @@ enum ScrollSetting { "" /* none */, "up" }; [Constructor] interface VTTRegion { + attribute DOMString id; attribute double width; attribute long lines; attribute double regionAnchorX;
diff --git a/third_party/WebKit/LayoutTests/fast/css/first-letter-float-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/css/first-letter-float-crash-expected.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/first-letter-float-crash-expected.txt
@@ -0,0 +1 @@ +
diff --git a/third_party/WebKit/LayoutTests/fast/css/first-letter-float-crash.html b/third_party/WebKit/LayoutTests/fast/css/first-letter-float-crash.html new file mode 100644 index 0000000..63ad097 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/first-letter-float-crash.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<style> +.c9::first-letter { float: inherit; } +.c9 { float: right; } +</style> +<script> +let hgroup = document.createElement('div'); +let ul = document.createElement('ul'); +let source = document.createElement('div'); +let ol = document.createElement('ol'); +ol.setAttribute('class', 'c9'); +let text1 = document.createTextNode('chzxnoxjhtepkinxemgkef'); +let text2 = document.createTextNode('1360056216'); + +let root = document.documentElement; +root.appendChild(hgroup); +root.appendChild(ol); +ol.appendChild(text2); +ol.appendChild(ul); +document.documentElement.offsetTop; +source.appendChild(ul); +document.documentElement.offsetTop; +ol.appendChild(text1); + +document.documentElement.offsetTop; +let e = document.documentElement; +e.parentNode.removeChild(e); + +if (window.testRunner) + testRunner.dumpAsText(); +</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt b/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt index 05032e3..cb7ab235 100644 --- a/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
@@ -252,6 +252,7 @@ CONSOLE MESSAGE: line 147: global object CONSOLE MESSAGE: line 147: attribute Atomics CONSOLE MESSAGE: line 147: attribute console +CONSOLE MESSAGE: line 147: getter devicePixelRatio CONSOLE MESSAGE: line 147: method gc CONSOLE MESSAGE: line 147: method registerPaint CONSOLE MESSAGE: line 147: interface ByteLengthQueuingStrategy @@ -507,6 +508,7 @@ CONSOLE MESSAGE: line 147: global object CONSOLE MESSAGE: line 147: attribute Atomics CONSOLE MESSAGE: line 147: attribute console +CONSOLE MESSAGE: line 147: getter devicePixelRatio CONSOLE MESSAGE: line 147: method gc CONSOLE MESSAGE: line 147: method registerPaint
diff --git a/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document-expected.html b/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document-expected.html new file mode 100644 index 0000000..f69f7dd4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document-expected.html
@@ -0,0 +1,27 @@ +<!DOCTYPE html> +<meta name="viewport" content="width=device-width, user-scalable=no" /> +<style> + ::-webkit-scrollbar { + width: 0px; + height: 0px; + } + html, body { + height: 100%; + width: 100%; + margin: 0; + } + body { + background-color: #808080; + } + #bottom { + position: fixed; + left: 50px; + right: 50px; + height: 20px; + bottom: 0px; + background-color: coral; + z-index: 2; + } +</style> + +<div id="bottom"></div>
diff --git a/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document-iframe-expected.html b/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document-iframe-expected.html new file mode 100644 index 0000000..fe12aad --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document-iframe-expected.html
@@ -0,0 +1,37 @@ +<!DOCTYPE html> +<meta name="viewport" content="width=device-width, user-scalable=no" /> +<style> + ::-webkit-scrollbar { + width: 0px; + height: 0px; + } + html, body { + height: 100%; + width: 100%; + margin: 0; + } + body { + background-color: #808080; + } + #bottom { + position: fixed; + left: 50px; + right: 50px; + height: 20px; + bottom: 0px; + background-color: coral; + z-index: 2; + } + #innerbottom { + position: fixed; + left: 100px; + right: 100px; + height: 30px; + bottom: 0px; + background-color: green; + z-index: 1; + } +</style> + +<div id="bottom"></div> +<div id="innerbottom"></div>
diff --git a/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document-iframe.html b/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document-iframe.html new file mode 100644 index 0000000..02ae791b --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document-iframe.html
@@ -0,0 +1,61 @@ +<!DOCTYPE html> +<meta name="viewport" content="width=device-width, user-scalable=no" /> +<script> + // This test is correct if the bottom of the screen has two bars, an orange + // one over top of a green one. + if (window.internals) { + window.internals.setBrowserControlsState(100, 0, false); + } + addEventListener("load", function() { + document.rootScroller = document.getElementById("iframe"); + }); +</script> +<style> + ::-webkit-scrollbar { + width: 0px; + height: 0px; + } + html, body { + height: 100%; + width: 100%; + margin: 0; + } + body { + background-color: red; + } + #iframe { + position: absolute; + width: 100%; + height: 100%; + border: 0; + } + #bottom { + position: fixed; + left: 50px; + right: 50px; + height: 20px; + bottom: 0px; + background-color: coral; + } +</style> + +<iframe id="iframe" srcdoc=" + <style> + html,body { + height: 100%; + width: 100%; + margin:0; + background-color: #808080; + } + #bottom { + position: fixed; + left: 100px; + right: 100px; + height: 30px; + bottom: 0px; + background-color: green; + } + </style> + <div style='height:2000px'></div> + <div id='bottom'></div>"></iframe> +<div id="bottom"></div>
diff --git a/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document.html b/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document.html new file mode 100644 index 0000000..ced33ec --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/android/fast/rootscroller/position-fixed-in-unscrollable-document.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<meta name="viewport" content="width=device-width, user-scalable=no" /> +<script> + // This test is correct if the bottom of the screen has two bars, an orange + // one over top of a green one. + if (window.internals) { + window.internals.setBrowserControlsState(100, 0, false); + } + addEventListener("load", function() { + document.rootScroller = document.getElementById("scroller"); + }); +</script> +<style> + ::-webkit-scrollbar { + width: 0px; + height: 0px; + } + html, body { + height: 100%; + width: 100%; + margin: 0; + } + body { + background-color: red; + } + #scroller { + position: absolute; + width: 100%; + height: 100%; + overflow: auto; + background-color: #808080; + } + #bottom { + position: fixed; + left: 50px; + right: 50px; + height: 20px; + bottom: 0px; + background-color: coral; + } +</style> + +<div id="scroller"> + <div style="height:2000px"></div> +</div> + +<div id="bottom"></div>
diff --git a/third_party/WebKit/LayoutTests/virtual/scalefactor200/external/wpt/css-paint-api/hidpi/README.txt b/third_party/WebKit/LayoutTests/virtual/scalefactor200/external/wpt/css-paint-api/hidpi/README.txt new file mode 100644 index 0000000..75f0fdf --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/scalefactor200/external/wpt/css-paint-api/hidpi/README.txt
@@ -0,0 +1,2 @@ +# This suite runs the tests in LayoutTests/external/wpt/css-paint-api/hidpi/ +# with the flag --force-device-scale-factor=2.
diff --git a/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp b/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp index 84280097..34545cd 100644 --- a/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp
@@ -12,6 +12,8 @@ void V8ConstructorAttributeGetter( v8::Local<v8::Name> property_name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT( + info.GetIsolate(), "Blink_V8ConstructorAttributeGetter"); v8::Local<v8::Value> data = info.Data(); DCHECK(data->IsExternal()); V8PerContextData* per_context_data =
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.cpp index 5c5b831..0e17ac9 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.cpp
@@ -25,6 +25,8 @@ void ScriptFunction::CallCallback( const v8::FunctionCallbackInfo<v8::Value>& args) { DCHECK(args.Data()->IsExternal()); + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(args.GetIsolate(), + "Blink_CallCallback"); ScriptFunction* script_function = static_cast<ScriptFunction*>( v8::Local<v8::External>::Cast(args.Data())->Value()); ScriptValue result = script_function->Call(
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLAllCollectionCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLAllCollectionCustom.cpp index e382a47..b4aeea3 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLAllCollectionCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLAllCollectionCustom.cpp
@@ -108,6 +108,8 @@ void V8HTMLAllCollection::legacyCallCustom( const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT( + info.GetIsolate(), "Blink_V8HTMLAllCollection_legacyCallCustom"); if (info.Length() < 1) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kDocumentAllLegacyCallNoArguments);
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py index d692b85..5942164f 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
@@ -198,7 +198,7 @@ setter_context(interface, attribute, interfaces, context) # [RuntimeCallStatsCounter] - runtime_call_stats_context(context, extended_attributes) + runtime_call_stats_context(interface, attribute, context) # [CrossOrigin] is incompatible with a number of other attributes, so check # for them here. @@ -213,14 +213,15 @@ return context -def runtime_call_stats_context(context, extended_attributes): - counter = '' - if 'RuntimeCallStatsCounter' in extended_attributes: - includes.add('platform/bindings/RuntimeCallStats.h') - counter = extended_attributes['RuntimeCallStatsCounter'] +def runtime_call_stats_context(interface, attribute, context): + includes.add('platform/bindings/RuntimeCallStats.h') + generic_counter_name = 'Blink_' + v8_utilities.cpp_name(interface) + '_' + attribute.name + (counter, extended_attribute_defined) = v8_utilities.rcs_counter_name(attribute, generic_counter_name) runtime_call_stats = { - 'getter_counter': 'k%s_Getter' % counter if counter else '', - 'setter_counter': 'k%s_Setter' % counter if counter else '' + 'extended_attribute_defined': extended_attribute_defined, + 'getter_counter': '%s_Getter' % counter, + 'setter_counter': '%s_Setter' % counter, + 'constructor_getter_callback_counter': '%s_ConstructorGetterCallback' % generic_counter_name, } context.update({ 'runtime_call_stats': runtime_call_stats
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_interface.py index b179253f..3b2d95b4 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py
@@ -172,6 +172,19 @@ return features +def runtime_call_stats_context(interface): + counter_prefix = 'Blink_' + v8_utilities.cpp_name(interface) + '_' + return { + 'constructor_counter': counter_prefix + 'Constructor', + 'cross_origin_named_getter_counter': counter_prefix + 'CrossOriginNamedGetter', + 'cross_origin_named_setter_counter': counter_prefix + 'CrossOriginNamedSetter', + 'indexed_property_getter_counter': counter_prefix + 'IndexedPropertyGetter', + 'named_constructor_attribute_getter_counter': counter_prefix + 'NamedConstructorAttributeGetter', + 'named_property_getter_counter': counter_prefix + 'NamedPropertyGetter', + 'named_property_query_counter': counter_prefix + 'NamedPropertyQuery', + 'named_property_setter_counter': counter_prefix + 'NamedPropertySetter', + } + def interface_context(interface, interfaces): """Creates a Jinja template context for an interface. @@ -260,6 +273,7 @@ 'V8Window', 'V8HTMLDocument', 'V8Document', 'V8Node', 'V8EventTarget'] context = { + 'active_scriptwrappable': active_scriptwrappable, 'context_enabled_feature_name': context_enabled_feature_name(interface), # [ContextEnabled] 'cpp_class': cpp_class_name, 'cpp_class_or_partial': cpp_class_name_or_partial, @@ -285,7 +299,7 @@ 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_function_name(interface), 'parent_interface': parent_interface, 'pass_cpp_type': cpp_name(interface) + '*', - 'active_scriptwrappable': active_scriptwrappable, + 'runtime_call_stats': runtime_call_stats_context(interface), 'runtime_enabled_feature_name': runtime_enabled_feature_name(interface), # [RuntimeEnabled] 'v8_class': v8_class_name, 'v8_class_or_partial': v8_class_name_or_partial, @@ -826,6 +840,7 @@ 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_function_name(constant), # [OriginTrialEnabled] 'origin_trial_feature_name': v8_utilities.origin_trial_feature_name(constant), # [OriginTrialEnabled] # FIXME: use 'reflected_name' as correct 'name' + 'rcs_counter': 'Blink_' + v8_utilities.cpp_name(interface) + '_' + constant.name + '_ConstantGetter', 'reflected_name': extended_attributes.get('Reflect', reflected_name(constant.name)), 'runtime_enabled_feature_name': runtime_enabled_feature_name(constant), # [RuntimeEnabled] 'value': constant.value, @@ -1339,6 +1354,7 @@ 'is_raises_exception': is_constructor_raises_exception, 'number_of_required_arguments': number_of_required_arguments(constructor), + 'rcs_counter': 'Blink_' + v8_utilities.cpp_name(interface) + '_ConstructorCallback' }
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_methods.py b/third_party/WebKit/Source/bindings/scripts/v8_methods.py index c3b5a63..81a09e5 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_methods.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_methods.py
@@ -109,6 +109,17 @@ idl_type.is_explicit_nullable) +def runtime_call_stats_context(interface, method): + includes.add('platform/bindings/RuntimeCallStats.h') + generic_counter_name = 'Blink_' + v8_utilities.cpp_name(interface) + '_' + method.name + (method_counter, extended_attribute_defined) = v8_utilities.rcs_counter_name(method, generic_counter_name) + return { + 'extended_attribute_defined': extended_attribute_defined, + 'method_counter': method_counter, + 'origin_safe_method_getter_counter': generic_counter_name + '_OriginSafeMethodGetter' + } + + def method_context(interface, method, is_visible=True): arguments = method.arguments extended_attributes = method.extended_attributes @@ -160,12 +171,6 @@ if 'LenientThis' in extended_attributes: raise Exception('[LenientThis] is not supported for operations.') - if 'RuntimeCallStatsCounter' in extended_attributes: - rcs_counter = 'k' + extended_attributes['RuntimeCallStatsCounter'] - includes.add('platform/bindings/RuntimeCallStats.h') - else: - rcs_counter = '' - argument_contexts = [ argument_context(interface, method, argument, index, is_visible=is_visible) for index, argument in enumerate(arguments)] @@ -229,7 +234,7 @@ 'origin_trial_feature_name': v8_utilities.origin_trial_feature_name(method), # [OriginTrialEnabled] 'property_attributes': property_attributes(interface, method), 'returns_promise': method.returns_promise, - 'rcs_counter': rcs_counter, + 'runtime_call_stats': runtime_call_stats_context(interface, method), 'runtime_enabled_feature_name': v8_utilities.runtime_enabled_feature_name(method), # [RuntimeEnabled] 'secure_context_test': v8_utilities.secure_context(method, interface), # [SecureContext] 'use_output_parameter_for_result': idl_type.use_output_parameter_for_result,
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py index b99ef2f..92649c2 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py
@@ -432,6 +432,16 @@ return definition_or_member.extended_attributes.get('ContextEnabled') +# [RuntimeCallStatsCounter] +def rcs_counter_name(member, generic_counter_name): + extended_attribute_defined = 'RuntimeCallStatsCounter' in member.extended_attributes + if extended_attribute_defined: + counter = 'k' + member.extended_attributes['RuntimeCallStatsCounter'] + else: + counter = generic_counter_name + return (counter, extended_attribute_defined) + + # [RuntimeEnabled] def runtime_enabled_feature_name(definition_or_member): extended_attributes = definition_or_member.extended_attributes
diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl index d5e358b..faf2bcc 100644 --- a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
@@ -1,5 +1,5 @@ {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_to_local_cpp_value %} -{% from 'methods.cpp.tmpl' import runtime_timer_scope, runtime_call_stats_enter, runtime_call_stats_leave %} +{% from 'methods.cpp.tmpl' import runtime_timer_scope, runtime_timer_scope_disabled_by_default %} {##############################################################################} {% macro attribute_getter(attribute, world_suffix) %} @@ -223,7 +223,11 @@ {%- else %} const v8::FunctionCallbackInfo<v8::Value>& info {%- endif %}) { + {% if attribute.runtime_call_stats.extended_attribute_defined %} {{ runtime_timer_scope(attribute.runtime_call_stats.getter_counter) | indent(2) }} + {% else %} + {{ runtime_timer_scope_disabled_by_default(attribute.runtime_call_stats.getter_counter) }} + {% endif %} {% if attribute.deprecate_as %} Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), WebFeature::k{{attribute.deprecate_as}}); @@ -270,6 +274,7 @@ {##############################################################################} {% macro constructor_getter_callback(attribute, world_suffix) %} void {{v8_class_or_partial}}::{{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(attribute.runtime_call_stats.constructor_getter_callback_counter) }} {% if attribute.deprecate_as %} Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), WebFeature::k{{attribute.deprecate_as}}); {% endif %} @@ -445,7 +450,11 @@ {%- else %} const v8::FunctionCallbackInfo<v8::Value>& info {%- endif %}) { + {% if attribute.runtime_call_stats.extended_attribute_defined %} {{ runtime_timer_scope(attribute.runtime_call_stats.setter_counter) | indent(2) }} + {% else %} + {{ runtime_timer_scope_disabled_by_default(attribute.runtime_call_stats.setter_counter) }} + {% endif %} {% if not attribute.is_data_type_property %} v8::Local<v8::Value> v8Value = info[0];
diff --git a/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl index ba0a97f..25eadf2 100644 --- a/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl
@@ -1,6 +1,9 @@ +{% from 'methods.cpp.tmpl' import runtime_timer_scope_disabled_by_default %} + {##############################################################################} {% macro constant_getter_callback(constant) %} void {{v8_class_or_partial}}::{{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(constant.rcs_counter) }} {% if constant.deprecate_as %} Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), WebFeature::k{{constant.deprecate_as}}); {% endif %}
diff --git a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl index 0836f93d..8a4f5082 100644 --- a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
@@ -1,5 +1,7 @@ {% extends 'interface_base.cpp.tmpl' %} +{% from 'methods.cpp.tmpl' import runtime_timer_scope, runtime_timer_scope_disabled_by_default %} + {##############################################################################} {% block indexed_property_getter %} {% if indexed_property_getter and not indexed_property_getter.is_custom %} @@ -40,6 +42,7 @@ {% if indexed_property_getter or named_property_getter %} {% set getter = indexed_property_getter or named_property_getter %} void {{v8_class_or_partial}}::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(runtime_call_stats.indexed_property_getter_counter) }} {% if indexed_property_getter %} {% if getter.is_custom %} @@ -345,6 +348,7 @@ {% if named_property_getter %} {% set getter = named_property_getter %} void {{v8_class_or_partial}}::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(runtime_call_stats.named_property_getter_counter) }} if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -412,6 +416,7 @@ {% if named_property_setter %} {% set setter = named_property_setter %} void {{v8_class_or_partial}}::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(runtime_call_stats.named_property_setter_counter) }} if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -532,6 +537,7 @@ {% if named_property_getter and named_property_getter.is_enumerable %} {% set getter = named_property_getter %} void {{v8_class_or_partial}}::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + {{ runtime_timer_scope_disabled_by_default(runtime_call_stats.named_property_query_counter) }} if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -674,6 +680,7 @@ void {{v8_class}}Constructor::NamedConstructorAttributeGetter( v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(runtime_call_stats.named_constructor_attribute_getter_counter) }} v8::Local<v8::Context> creationContext = info.Holder()->CreationContext(); V8PerContextData* perContextData = V8PerContextData::From(creationContext); if (!perContextData) { @@ -748,6 +755,7 @@ {% block constructor_callback %} {% if constructors or has_custom_constructor or has_html_constructor %} void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(runtime_call_stats.constructor_counter) }} {% if measure_as %} UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::k{{measure_as('Constructor')}}); {% endif %}
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl index c4c65283..470454f7 100644 --- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
@@ -266,6 +266,7 @@ {% if has_cross_origin_named_getter %} void {{v8_class_or_partial}}::crossOriginNamedGetter(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(runtime_call_stats.cross_origin_named_getter_counter) }} if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -294,6 +295,7 @@ {% if has_cross_origin_named_setter %} void {{v8_class_or_partial}}::crossOriginNamedSetter(v8::Local<v8::Name> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(runtime_call_stats.cross_origin_named_setter_counter) }} if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>());
diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl index 4c693bb..cd4e1990 100644 --- a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
@@ -2,10 +2,11 @@ {##############################################################################} {% macro runtime_timer_scope(counter) %} -{% if counter -%} -RUNTIME_CALL_TIMER_SCOPE(info.GetIsolate(), - RuntimeCallStats::CounterId::{{counter}}); -{%- endif %} +RUNTIME_CALL_TIMER_SCOPE(info.GetIsolate(), RuntimeCallStats::CounterId::{{counter}}); +{% endmacro %} + +{% macro runtime_timer_scope_disabled_by_default(counter) %} +RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "{{counter}}"); {% endmacro %} {% macro generate_method(method, world_suffix) %} @@ -493,7 +494,11 @@ {##############################################################################} {% macro method_callback(method, world_suffix) %} void {{v8_class_or_partial}}::{{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) { - {{runtime_timer_scope(method.rcs_counter) | indent(2)}} + {% if method.extended_attribute_defined %} + {{ runtime_timer_scope(method.runtime_call_stats.method_counter) | indent(2) }} + {% else %} + {{ runtime_timer_scope_disabled_by_default(method.runtime_call_stats.method_counter) }} + {% endif %} {% if not method.overloads %}{# Overloaded methods are measured in overload_resolution_method() #} {% if method.measure_as %} UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::k{{method.measure_as('Method')}}); @@ -565,6 +570,7 @@ {% macro origin_safe_method_getter_callback(method, world_suffix) %} void {{v8_class_or_partial}}::{{method.name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(method.runtime_call_stats.origin_safe_method_getter_counter) }} {{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix}}(info); } {% endmacro %} @@ -576,6 +582,7 @@ if constructor.is_named_constructor else 'constructor%s' % (constructor.overload_index or '') %} static void {{name}}(const v8::FunctionCallbackInfo<v8::Value>& info) { + {{ runtime_timer_scope_disabled_by_default(constructor.rcs_counter) }} {% set function_call = func_call_with_prep_of_args(constructor) %} {% if constructor.is_named_constructor %}
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp index c72311bb..b3a4c9f 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp
@@ -18,6 +18,7 @@ #include "bindings/core/v8/V8DOMConfiguration.h" #include "bindings/core/v8/V8SharedArrayBuffer.h" #include "core/dom/ExecutionContext.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h"
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp index 0624223..91622ad 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp
@@ -28,6 +28,7 @@ #include "bindings/core/v8/V8Uint8Array.h" #include "bindings/core/v8/V8Uint8ClampedArray.h" #include "core/dom/ExecutionContext.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/bindings/V8PrivateProperty.h" #include "platform/wtf/GetPtr.h"
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp index 34c88eb..14c3283 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp
@@ -18,6 +18,7 @@ #include "bindings/core/v8/V8DOMConfiguration.h" #include "bindings/core/v8/V8SharedArrayBuffer.h" #include "core/dom/ExecutionContext.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h"
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp index ab5eaae3..9fb5a3a3e 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp
@@ -18,6 +18,7 @@ #include "core/SVGNames.h" #include "core/dom/ExecutionContext.h" #include "core/html/custom/V0CustomElementProcessingStack.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -98,10 +99,14 @@ } // namespace SVGTestInterfaceV8Internal void V8SVGTestInterface::typeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_SVGTestInterface_type_Getter"); + SVGTestInterfaceV8Internal::typeAttributeGetter(info); } void V8SVGTestInterface::typeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_SVGTestInterface_type_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp index a09ac74..c491cb88 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
@@ -20,6 +20,7 @@ #include "bindings/core/v8/VoidCallbackFunction.h" #include "core/dom/ExecutionContext.h" #include "core/html/custom/V0CustomElementProcessingStack.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -200,38 +201,56 @@ } // namespace TestCallbackFunctionsV8Internal void V8TestCallbackFunctions::customElementsCallbacksReadonlyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestCallbackFunctions_customElementsCallbacksReadonlyAttribute_Getter"); + TestCallbackFunctionsV8Internal::customElementsCallbacksReadonlyAttributeAttributeGetter(info); } void V8TestCallbackFunctions::returnCallbackFunctionMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestCallbackFunctions_returnCallbackFunctionMethod"); + TestCallbackFunctionsV8Internal::returnCallbackFunctionMethodMethod(info); } void V8TestCallbackFunctions::returnCallbackFunctionMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestCallbackFunctions_returnCallbackFunctionMethod2"); + TestCallbackFunctionsV8Internal::returnCallbackFunctionMethod2Method(info); } void V8TestCallbackFunctions::voidMethodCallbackFunctionInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestCallbackFunctions_voidMethodCallbackFunctionInArg"); + TestCallbackFunctionsV8Internal::voidMethodCallbackFunctionInArgMethod(info); } void V8TestCallbackFunctions::voidMethodCallbackFunctionInArg2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestCallbackFunctions_voidMethodCallbackFunctionInArg2"); + TestCallbackFunctionsV8Internal::voidMethodCallbackFunctionInArg2Method(info); } void V8TestCallbackFunctions::voidMethodCallbackFunctionWithReturnValueInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestCallbackFunctions_voidMethodCallbackFunctionWithReturnValueInArg"); + TestCallbackFunctionsV8Internal::voidMethodCallbackFunctionWithReturnValueInArgMethod(info); } void V8TestCallbackFunctions::voidMethodOptionalCallbackFunctionInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestCallbackFunctions_voidMethodOptionalCallbackFunctionInArg"); + TestCallbackFunctionsV8Internal::voidMethodOptionalCallbackFunctionInArgMethod(info); } void V8TestCallbackFunctions::voidMethodNullableCallbackFunctionInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestCallbackFunctions_voidMethodNullableCallbackFunctionInArg"); + TestCallbackFunctionsV8Internal::voidMethodNullableCallbackFunctionInArgMethod(info); } void V8TestCallbackFunctions::customElementCallbacksMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestCallbackFunctions_customElementCallbacksMethod"); + TestCallbackFunctionsV8Internal::customElementCallbacksMethodMethod(info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp index d2afdd9..7b4d8aa 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp
@@ -71,11 +71,15 @@ } // namespace TestConstantsV8Internal void V8TestConstants::DEPRECATED_CONSTANTConstantGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestConstants_DEPRECATED_CONSTANT_ConstantGetter"); + Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), WebFeature::kConstant); V8SetReturnValueInt(info, 1); } void V8TestConstants::MEASURED_CONSTANTConstantGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestConstants_MEASURED_CONSTANT_ConstantGetter"); + UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kConstant); V8SetReturnValueInt(info, 1); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp index 8ad6f33..ba51ede 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp
@@ -18,6 +18,7 @@ #include "bindings/core/v8/V8Document.h" #include "bindings/core/v8/V8Node.h" #include "core/dom/ExecutionContext.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -139,20 +140,28 @@ } // namespace TestIntegerIndexedV8Internal void V8TestIntegerIndexed::lengthAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_length_Getter"); + TestIntegerIndexedV8Internal::lengthAttributeGetter(info); } void V8TestIntegerIndexed::lengthAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_length_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestIntegerIndexedV8Internal::lengthAttributeSetter(v8Value, info); } void V8TestIntegerIndexed::voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_voidMethodDocument"); + TestIntegerIndexedV8Internal::voidMethodDocumentMethod(info); } void V8TestIntegerIndexed::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_NamedPropertyGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -161,6 +170,8 @@ } void V8TestIntegerIndexed::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_NamedPropertySetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -177,6 +188,8 @@ } void V8TestIntegerIndexed::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_NamedPropertyQuery"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -189,6 +202,8 @@ } void V8TestIntegerIndexed::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_IndexedPropertyGetter"); + V8TestIntegerIndexed::indexedPropertyGetterCustom(index, info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp index cae5cae..f43f2cd 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp
@@ -18,6 +18,7 @@ #include "bindings/core/v8/V8Document.h" #include "bindings/core/v8/V8Node.h" #include "core/dom/ExecutionContext.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -139,20 +140,28 @@ } // namespace TestIntegerIndexedGlobalV8Internal void V8TestIntegerIndexedGlobal::lengthAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedGlobal_length_Getter"); + TestIntegerIndexedGlobalV8Internal::lengthAttributeGetter(info); } void V8TestIntegerIndexedGlobal::lengthAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedGlobal_length_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestIntegerIndexedGlobalV8Internal::lengthAttributeSetter(v8Value, info); } void V8TestIntegerIndexedGlobal::voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedGlobal_voidMethodDocument"); + TestIntegerIndexedGlobalV8Internal::voidMethodDocumentMethod(info); } void V8TestIntegerIndexedGlobal::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedGlobal_NamedPropertyGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -161,6 +170,8 @@ } void V8TestIntegerIndexedGlobal::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedGlobal_NamedPropertySetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -177,6 +188,8 @@ } void V8TestIntegerIndexedGlobal::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedGlobal_NamedPropertyQuery"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -189,6 +202,8 @@ } void V8TestIntegerIndexedGlobal::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedGlobal_IndexedPropertyGetter"); + V8TestIntegerIndexedGlobal::indexedPropertyGetterCustom(index, info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp index 09b77f9..5f581c4 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp
@@ -18,6 +18,7 @@ #include "bindings/core/v8/V8Document.h" #include "bindings/core/v8/V8Node.h" #include "core/dom/ExecutionContext.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -139,20 +140,28 @@ } // namespace TestIntegerIndexedPrimaryGlobalV8Internal void V8TestIntegerIndexedPrimaryGlobal::lengthAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedPrimaryGlobal_length_Getter"); + TestIntegerIndexedPrimaryGlobalV8Internal::lengthAttributeGetter(info); } void V8TestIntegerIndexedPrimaryGlobal::lengthAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedPrimaryGlobal_length_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestIntegerIndexedPrimaryGlobalV8Internal::lengthAttributeSetter(v8Value, info); } void V8TestIntegerIndexedPrimaryGlobal::voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedPrimaryGlobal_voidMethodDocument"); + TestIntegerIndexedPrimaryGlobalV8Internal::voidMethodDocumentMethod(info); } void V8TestIntegerIndexedPrimaryGlobal::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedPrimaryGlobal_NamedPropertyGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -161,6 +170,8 @@ } void V8TestIntegerIndexedPrimaryGlobal::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedPrimaryGlobal_NamedPropertySetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -177,6 +188,8 @@ } void V8TestIntegerIndexedPrimaryGlobal::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedPrimaryGlobal_NamedPropertyQuery"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -189,6 +202,8 @@ } void V8TestIntegerIndexedPrimaryGlobal::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexedPrimaryGlobal_IndexedPropertyGetter"); + V8TestIntegerIndexedPrimaryGlobal::indexedPropertyGetterCustom(index, info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp index 7cd9e0be..46d3aeb 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
@@ -34,6 +34,7 @@ #include "core/frame/UseCounter.h" #include "core/inspector/ConsoleMessage.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/ScriptState.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" @@ -2192,12 +2193,16 @@ } // namespace TestInterfaceImplementationV8Internal void V8TestInterface::testInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_testInterfaceAttribute_Getter"); + UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kV8TestInterface_TestInterfaceAttribute_AttributeGetter); TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeGetter(info); } void V8TestInterface::testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_testInterfaceAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kV8TestInterface_TestInterfaceAttribute_AttributeSetter); @@ -2206,680 +2211,976 @@ } void V8TestInterface::doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_doubleAttribute_Getter"); + TestInterfaceImplementationV8Internal::doubleAttributeAttributeGetter(info); } void V8TestInterface::doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_doubleAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::doubleAttributeAttributeSetter(v8Value, info); } void V8TestInterface::floatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_floatAttribute_Getter"); + TestInterfaceImplementationV8Internal::floatAttributeAttributeGetter(info); } void V8TestInterface::floatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_floatAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::floatAttributeAttributeSetter(v8Value, info); } void V8TestInterface::unrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_unrestrictedDoubleAttribute_Getter"); + TestInterfaceImplementationV8Internal::unrestrictedDoubleAttributeAttributeGetter(info); } void V8TestInterface::unrestrictedDoubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_unrestrictedDoubleAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::unrestrictedDoubleAttributeAttributeSetter(v8Value, info); } void V8TestInterface::unrestrictedFloatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_unrestrictedFloatAttribute_Getter"); + TestInterfaceImplementationV8Internal::unrestrictedFloatAttributeAttributeGetter(info); } void V8TestInterface::unrestrictedFloatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_unrestrictedFloatAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::unrestrictedFloatAttributeAttributeSetter(v8Value, info); } void V8TestInterface::testEnumAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_testEnumAttribute_Getter"); + TestInterfaceImplementationV8Internal::testEnumAttributeAttributeGetter(info); } void V8TestInterface::testEnumAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_testEnumAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::testEnumAttributeAttributeSetter(v8Value, info); } void V8TestInterface::stringOrDoubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_stringOrDoubleAttribute_Getter"); + TestInterfaceImplementationV8Internal::stringOrDoubleAttributeAttributeGetter(info); } void V8TestInterface::stringOrDoubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_stringOrDoubleAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::stringOrDoubleAttributeAttributeSetter(v8Value, info); } void V8TestInterface::conditionalLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_conditionalLongAttribute_Getter"); + TestInterfaceImplementationV8Internal::conditionalLongAttributeAttributeGetter(info); } void V8TestInterface::conditionalLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_conditionalLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::conditionalLongAttributeAttributeSetter(v8Value, info); } void V8TestInterface::conditionalReadOnlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_conditionalReadOnlyLongAttribute_Getter"); + TestInterfaceImplementationV8Internal::conditionalReadOnlyLongAttributeAttributeGetter(info); } void V8TestInterface::staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_staticStringAttribute_Getter"); + TestInterfaceImplementationV8Internal::staticStringAttributeAttributeGetter(info); } void V8TestInterface::staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_staticStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::staticStringAttributeAttributeSetter(v8Value, info); } void V8TestInterface::staticReturnDOMWrapperAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_staticReturnDOMWrapperAttribute_Getter"); + TestInterfaceImplementationV8Internal::staticReturnDOMWrapperAttributeAttributeGetter(info); } void V8TestInterface::staticReturnDOMWrapperAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_staticReturnDOMWrapperAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::staticReturnDOMWrapperAttributeAttributeSetter(v8Value, info); } void V8TestInterface::staticReadOnlyStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_staticReadOnlyStringAttribute_Getter"); + TestInterfaceImplementationV8Internal::staticReadOnlyStringAttributeAttributeGetter(info); } void V8TestInterface::staticReadOnlyReturnDOMWrapperAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_staticReadOnlyReturnDOMWrapperAttribute_Getter"); + TestInterfaceImplementationV8Internal::staticReadOnlyReturnDOMWrapperAttributeAttributeGetter(info); } void V8TestInterface::staticConditionalReadOnlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_staticConditionalReadOnlyLongAttribute_Getter"); + TestInterfaceImplementationV8Internal::staticConditionalReadOnlyLongAttributeAttributeGetter(info); } void V8TestInterface::legacyInterfaceTypeCheckingAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_legacyInterfaceTypeCheckingAttribute_Getter"); + TestInterfaceImplementationV8Internal::legacyInterfaceTypeCheckingAttributeAttributeGetter(info); } void V8TestInterface::legacyInterfaceTypeCheckingAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_legacyInterfaceTypeCheckingAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::legacyInterfaceTypeCheckingAttributeAttributeSetter(v8Value, info); } void V8TestInterface::alwaysExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_alwaysExposedAttribute_Getter"); + TestInterfaceImplementationV8Internal::alwaysExposedAttributeAttributeGetter(info); } void V8TestInterface::alwaysExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_alwaysExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::alwaysExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterface::workerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_workerExposedAttribute_Getter"); + TestInterfaceImplementationV8Internal::workerExposedAttributeAttributeGetter(info); } void V8TestInterface::workerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_workerExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::workerExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterface::windowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_windowExposedAttribute_Getter"); + TestInterfaceImplementationV8Internal::windowExposedAttributeAttributeGetter(info); } void V8TestInterface::windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_windowExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::windowExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterface::lenientThisAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_lenientThisAttribute_Getter"); + TestInterfaceImplementationV8Internal::lenientThisAttributeAttributeGetter(info); } void V8TestInterface::lenientThisAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_lenientThisAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::lenientThisAttributeAttributeSetter(v8Value, info); } void V8TestInterface::secureContextAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextAttribute_Getter"); + TestInterfaceImplementationV8Internal::secureContextAttributeAttributeGetter(info); } void V8TestInterface::secureContextAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::secureContextAttributeAttributeSetter(v8Value, info); } void V8TestInterface::secureContextRuntimeEnabledAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextRuntimeEnabledAttribute_Getter"); + TestInterfaceImplementationV8Internal::secureContextRuntimeEnabledAttributeAttributeGetter(info); } void V8TestInterface::secureContextRuntimeEnabledAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextRuntimeEnabledAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::secureContextRuntimeEnabledAttributeAttributeSetter(v8Value, info); } void V8TestInterface::secureContextWindowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWindowExposedAttribute_Getter"); + TestInterfaceImplementationV8Internal::secureContextWindowExposedAttributeAttributeGetter(info); } void V8TestInterface::secureContextWindowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWindowExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::secureContextWindowExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterface::secureContextWorkerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWorkerExposedAttribute_Getter"); + TestInterfaceImplementationV8Internal::secureContextWorkerExposedAttributeAttributeGetter(info); } void V8TestInterface::secureContextWorkerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWorkerExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::secureContextWorkerExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterface::secureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWindowExposedRuntimeEnabledAttribute_Getter"); + TestInterfaceImplementationV8Internal::secureContextWindowExposedRuntimeEnabledAttributeAttributeGetter(info); } void V8TestInterface::secureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWindowExposedRuntimeEnabledAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::secureContextWindowExposedRuntimeEnabledAttributeAttributeSetter(v8Value, info); } void V8TestInterface::secureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWorkerExposedRuntimeEnabledAttribute_Getter"); + TestInterfaceImplementationV8Internal::secureContextWorkerExposedRuntimeEnabledAttributeAttributeGetter(info); } void V8TestInterface::secureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWorkerExposedRuntimeEnabledAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::secureContextWorkerExposedRuntimeEnabledAttributeAttributeSetter(v8Value, info); } void V8TestInterface::implementsStaticReadOnlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsStaticReadOnlyLongAttribute_Getter"); + TestInterfaceImplementationV8Internal::implementsStaticReadOnlyLongAttributeAttributeGetter(info); } void V8TestInterface::implementsStaticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsStaticStringAttribute_Getter"); + TestInterfaceImplementationV8Internal::implementsStaticStringAttributeAttributeGetter(info); } void V8TestInterface::implementsStaticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsStaticStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::implementsStaticStringAttributeAttributeSetter(v8Value, info); } void V8TestInterface::implementsReadonlyStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsReadonlyStringAttribute_Getter"); + TestInterfaceImplementationV8Internal::implementsReadonlyStringAttributeAttributeGetter(info); } void V8TestInterface::implementsStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsStringAttribute_Getter"); + TestInterfaceImplementationV8Internal::implementsStringAttributeAttributeGetter(info); } void V8TestInterface::implementsStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::implementsStringAttributeAttributeSetter(v8Value, info); } void V8TestInterface::implementsNodeAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsNodeAttribute_Getter"); + TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeGetter(info); } void V8TestInterface::implementsNodeAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsNodeAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeSetter(v8Value, info); } void V8TestInterface::implementsEventHandlerAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsEventHandlerAttribute_Getter"); + TestInterfaceImplementationV8Internal::implementsEventHandlerAttributeAttributeGetter(info); } void V8TestInterface::implementsEventHandlerAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsEventHandlerAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::implementsEventHandlerAttributeAttributeSetter(v8Value, info); } void V8TestInterface::implementsRuntimeEnabledNodeAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsRuntimeEnabledNodeAttribute_Getter"); + TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGetter(info); } void V8TestInterface::implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsRuntimeEnabledNodeAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSetter(v8Value, info); } void V8TestInterface::implements2StaticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements2StaticStringAttribute_Getter"); + TestInterfaceImplementationV8Internal::implements2StaticStringAttributeAttributeGetter(info); } void V8TestInterface::implements2StaticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements2StaticStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::implements2StaticStringAttributeAttributeSetter(v8Value, info); } void V8TestInterface::implements2StringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements2StringAttribute_Getter"); + TestInterfaceImplementationV8Internal::implements2StringAttributeAttributeGetter(info); } void V8TestInterface::implements2StringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements2StringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::implements2StringAttributeAttributeSetter(v8Value, info); } void V8TestInterface::implements3StringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements3StringAttribute_Getter"); + TestInterfaceImplementationV8Internal::implements3StringAttributeAttributeGetter(info); } void V8TestInterface::implements3StringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements3StringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::implements3StringAttributeAttributeSetter(v8Value, info); } void V8TestInterface::implements3StaticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements3StaticStringAttribute_Getter"); + TestInterfaceImplementationV8Internal::implements3StaticStringAttributeAttributeGetter(info); } void V8TestInterface::implements3StaticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements3StaticStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::implements3StaticStringAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialLongAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialLongAttributeAttributeGetter(info); } void V8TestInterface::partialLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialLongAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialStaticLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialStaticLongAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialStaticLongAttributeAttributeGetter(info); } void V8TestInterface::partialStaticLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialStaticLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialStaticLongAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialCallWithExecutionContextLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialCallWithExecutionContextLongAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialCallWithExecutionContextLongAttributeAttributeGetter(info); } void V8TestInterface::partialCallWithExecutionContextLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialCallWithExecutionContextLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialCallWithExecutionContextLongAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialPartialEnumTypeAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialPartialEnumTypeAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttributeGetter(info); } void V8TestInterface::partialPartialEnumTypeAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialPartialEnumTypeAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialSecureContextLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextLongAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialSecureContextLongAttributeAttributeGetter(info); } void V8TestInterface::partialSecureContextLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialSecureContextLongAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partial2LongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial2LongAttribute_Getter"); + TestInterfaceImplementationV8Internal::partial2LongAttributeAttributeGetter(info); } void V8TestInterface::partial2LongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial2LongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partial2LongAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partial2StaticLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial2StaticLongAttribute_Getter"); + TestInterfaceImplementationV8Internal::partial2StaticLongAttributeAttributeGetter(info); } void V8TestInterface::partial2StaticLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial2StaticLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partial2StaticLongAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partial2SecureContextAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial2SecureContextAttribute_Getter"); + TestInterfaceImplementationV8Internal::partial2SecureContextAttributeAttributeGetter(info); } void V8TestInterface::partial2SecureContextAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial2SecureContextAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partial2SecureContextAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialSecureContextAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialSecureContextAttributeAttributeGetter(info); } void V8TestInterface::partialSecureContextAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialSecureContextAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialSecureContextRuntimeEnabledAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextRuntimeEnabledAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialSecureContextRuntimeEnabledAttributeAttributeGetter(info); } void V8TestInterface::partialSecureContextRuntimeEnabledAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextRuntimeEnabledAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialSecureContextRuntimeEnabledAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialSecureContextWindowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWindowExposedAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialSecureContextWindowExposedAttributeAttributeGetter(info); } void V8TestInterface::partialSecureContextWindowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWindowExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialSecureContextWindowExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialSecureContextWorkerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWorkerExposedAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedAttributeAttributeGetter(info); } void V8TestInterface::partialSecureContextWorkerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWorkerExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialSecureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWindowExposedRuntimeEnabledAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialSecureContextWindowExposedRuntimeEnabledAttributeAttributeGetter(info); } void V8TestInterface::partialSecureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWindowExposedRuntimeEnabledAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialSecureContextWindowExposedRuntimeEnabledAttributeAttributeSetter(v8Value, info); } void V8TestInterface::partialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWorkerExposedRuntimeEnabledAttribute_Getter"); + TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetter(info); } void V8TestInterface::partialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWorkerExposedRuntimeEnabledAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetter(v8Value, info); } void V8TestInterface::voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_voidMethodTestInterfaceEmptyArg"); + TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod(info); } void V8TestInterface::voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_voidMethodDoubleArgFloatArg"); + TestInterfaceImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(info); } void V8TestInterface::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg"); + TestInterfaceImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(info); } void V8TestInterface::voidMethodTestEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_voidMethodTestEnumArg"); + TestInterfaceImplementationV8Internal::voidMethodTestEnumArgMethod(info); } void V8TestInterface::voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_voidMethod"); + TestInterfaceImplementationV8Internal::voidMethodMethod(info); } void V8TestInterface::voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_voidMethod"); + TestInterfaceImplementationV8Internal::voidMethodMethodForMainWorld(info); } void V8TestInterface::alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_alwaysExposedMethod"); + TestInterfaceImplementationV8Internal::alwaysExposedMethodMethod(info); } void V8TestInterface::workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_workerExposedMethod"); + TestInterfaceImplementationV8Internal::workerExposedMethodMethod(info); } void V8TestInterface::windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_windowExposedMethod"); + TestInterfaceImplementationV8Internal::windowExposedMethodMethod(info); } void V8TestInterface::alwaysExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_alwaysExposedStaticMethod"); + TestInterfaceImplementationV8Internal::alwaysExposedStaticMethodMethod(info); } void V8TestInterface::workerExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_workerExposedStaticMethod"); + TestInterfaceImplementationV8Internal::workerExposedStaticMethodMethod(info); } void V8TestInterface::windowExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_windowExposedStaticMethod"); + TestInterfaceImplementationV8Internal::windowExposedStaticMethodMethod(info); } void V8TestInterface::staticReturnDOMWrapperMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_staticReturnDOMWrapperMethod"); + TestInterfaceImplementationV8Internal::staticReturnDOMWrapperMethodMethod(info); } void V8TestInterface::methodWithExposedAndRuntimeEnabledFlagMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_methodWithExposedAndRuntimeEnabledFlag"); + TestInterfaceImplementationV8Internal::methodWithExposedAndRuntimeEnabledFlagMethod(info); } void V8TestInterface::overloadMethodWithExposedAndRuntimeEnabledFlagMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_overloadMethodWithExposedAndRuntimeEnabledFlag"); + TestInterfaceImplementationV8Internal::overloadMethodWithExposedAndRuntimeEnabledFlagMethod(info); } void V8TestInterface::methodWithExposedHavingRuntimeEnabldFlagMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_methodWithExposedHavingRuntimeEnabldFlag"); + TestInterfaceImplementationV8Internal::methodWithExposedHavingRuntimeEnabldFlagMethod(info); } void V8TestInterface::windowAndServiceWorkerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_windowAndServiceWorkerExposedMethod"); + TestInterfaceImplementationV8Internal::windowAndServiceWorkerExposedMethodMethod(info); } void V8TestInterface::legacyInterfaceTypeCheckingMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_legacyInterfaceTypeCheckingMethod"); + TestInterfaceImplementationV8Internal::legacyInterfaceTypeCheckingMethodMethod(info); } void V8TestInterface::secureContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextMethod"); + TestInterfaceImplementationV8Internal::secureContextMethodMethod(info); } void V8TestInterface::secureContextRuntimeEnabledMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextRuntimeEnabledMethod"); + TestInterfaceImplementationV8Internal::secureContextRuntimeEnabledMethodMethod(info); } void V8TestInterface::secureContextWindowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWindowExposedMethod"); + TestInterfaceImplementationV8Internal::secureContextWindowExposedMethodMethod(info); } void V8TestInterface::secureContextWorkerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWorkerExposedMethod"); + TestInterfaceImplementationV8Internal::secureContextWorkerExposedMethodMethod(info); } void V8TestInterface::secureContextWindowExposedRuntimeEnabledMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWindowExposedRuntimeEnabledMethod"); + TestInterfaceImplementationV8Internal::secureContextWindowExposedRuntimeEnabledMethodMethod(info); } void V8TestInterface::secureContextWorkerExposedRuntimeEnabledMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_secureContextWorkerExposedRuntimeEnabledMethod"); + TestInterfaceImplementationV8Internal::secureContextWorkerExposedRuntimeEnabledMethodMethod(info); } void V8TestInterface::implementsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsVoidMethod"); + TestInterfaceImplementationV8Internal::implementsVoidMethodMethod(info); } void V8TestInterface::implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsComplexMethod"); + TestInterfaceImplementationV8Internal::implementsComplexMethodMethod(info); } void V8TestInterface::implementsCustomVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsCustomVoidMethod"); + V8TestInterface::implementsCustomVoidMethodMethodCustom(info); } void V8TestInterface::implementsStaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implementsStaticVoidMethod"); + TestInterfaceImplementationV8Internal::implementsStaticVoidMethodMethod(info); } void V8TestInterface::implements2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements2VoidMethod"); + TestInterfaceImplementationV8Internal::implements2VoidMethodMethod(info); } void V8TestInterface::implements3VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements3VoidMethod"); + TestInterfaceImplementationV8Internal::implements3VoidMethodMethod(info); } void V8TestInterface::implements3StaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_implements3StaticVoidMethod"); + TestInterfaceImplementationV8Internal::implements3StaticVoidMethodMethod(info); } void V8TestInterface::partialVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialVoidMethod"); + TestInterfaceImplementationV8Internal::partialVoidMethodMethod(info); } void V8TestInterface::partialStaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialStaticVoidMethod"); + TestInterfaceImplementationV8Internal::partialStaticVoidMethodMethod(info); } void V8TestInterface::partialVoidMethodLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialVoidMethodLongArg"); + TestInterfaceImplementationV8Internal::partialVoidMethodLongArgMethod(info); } void V8TestInterface::partialCallWithExecutionContextRaisesExceptionVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialCallWithExecutionContextRaisesExceptionVoidMethod"); + TestInterfaceImplementationV8Internal::partialCallWithExecutionContextRaisesExceptionVoidMethodMethod(info); } void V8TestInterface::partialVoidMethodPartialCallbackTypeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialVoidMethodPartialCallbackTypeArg"); + TestInterfaceImplementationV8Internal::partialVoidMethodPartialCallbackTypeArgMethod(info); } void V8TestInterface::partial2SecureContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial2SecureContextMethod"); + TestInterfaceImplementationV8Internal::partial2SecureContextMethodMethod(info); } void V8TestInterface::partialSecureContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextMethod"); + TestInterfaceImplementationV8Internal::partialSecureContextMethodMethod(info); } void V8TestInterface::partialSecureContextRuntimeEnabledMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextRuntimeEnabledMethod"); + TestInterfaceImplementationV8Internal::partialSecureContextRuntimeEnabledMethodMethod(info); } void V8TestInterface::partialSecureContextWindowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWindowExposedMethod"); + TestInterfaceImplementationV8Internal::partialSecureContextWindowExposedMethodMethod(info); } void V8TestInterface::partialSecureContextWorkerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWorkerExposedMethod"); + TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedMethodMethod(info); } void V8TestInterface::partialSecureContextWindowExposedRuntimeEnabledMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWindowExposedRuntimeEnabledMethod"); + TestInterfaceImplementationV8Internal::partialSecureContextWindowExposedRuntimeEnabledMethodMethod(info); } void V8TestInterface::partialSecureContextWorkerExposedRuntimeEnabledMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialSecureContextWorkerExposedRuntimeEnabledMethod"); + TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedRuntimeEnabledMethodMethod(info); } void V8TestInterface::voidMethodPartialOverloadMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_voidMethodPartialOverload"); + TestInterfaceImplementationV8Internal::voidMethodPartialOverloadMethod(info); } void V8TestInterface::staticVoidMethodPartialOverloadMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_staticVoidMethodPartialOverload"); + TestInterfaceImplementationV8Internal::staticVoidMethodPartialOverloadMethod(info); } void V8TestInterface::promiseMethodPartialOverloadMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_promiseMethodPartialOverload"); + TestInterfaceImplementationV8Internal::promiseMethodPartialOverloadMethod(info); } void V8TestInterface::staticPromiseMethodPartialOverloadMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_staticPromiseMethodPartialOverload"); + TestInterfaceImplementationV8Internal::staticPromiseMethodPartialOverloadMethod(info); } void V8TestInterface::partial2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial2VoidMethod"); + TestInterfaceImplementationV8Internal::partial2VoidMethodMethod(info); } void V8TestInterface::partial2StaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial2StaticVoidMethod"); + TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethod(info); } void V8TestInterface::keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_keys"); + TestInterfaceImplementationV8Internal::keysMethod(info); } void V8TestInterface::valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_values"); + TestInterfaceImplementationV8Internal::valuesMethod(info); } void V8TestInterface::forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_forEach"); + TestInterfaceImplementationV8Internal::forEachMethod(info); } void V8TestInterface::toJSONMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_toJSON"); + TestInterfaceImplementationV8Internal::toJSONMethod(info); } void V8TestInterface::toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_toString"); + TestInterfaceImplementationV8Internal::toStringMethod(info); } void V8TestInterface::iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_iterator"); + TestInterfaceImplementationV8Internal::iteratorMethod(info); } void V8TestInterface::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_NamedPropertyGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -2888,6 +3189,8 @@ } void V8TestInterface::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_NamedPropertySetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -2904,6 +3207,8 @@ } void V8TestInterface::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_NamedPropertyQuery"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -2916,6 +3221,8 @@ } void V8TestInterface::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_IndexedPropertyGetter"); + TestInterfaceImplementationV8Internal::indexedPropertyGetter(index, info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp index 03f47035..24cbeb3a 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
@@ -21,6 +21,7 @@ #include "core/dom/ExecutionContext.h" #include "core/frame/LocalDOMWindow.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/ScriptState.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" @@ -356,6 +357,8 @@ } static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_ConstructorCallback"); + TestInterface2* impl = TestInterface2::Create(); v8::Local<v8::Object> wrapper = info.Holder(); wrapper = impl->AssociateWithWrapper(info.GetIsolate(), &V8TestInterface2::wrapperTypeInfo, wrapper); @@ -506,66 +509,98 @@ } // namespace TestInterface2V8Internal void V8TestInterface2::sizeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_size_Getter"); + TestInterface2V8Internal::sizeAttributeGetter(info); } void V8TestInterface2::legacyCallerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_legacyCaller"); + TestInterface2V8Internal::legacyCallerMethod(info); } void V8TestInterface2::itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_item"); + TestInterface2V8Internal::itemMethod(info); } void V8TestInterface2::setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_setItem"); + TestInterface2V8Internal::setItemMethod(info); } void V8TestInterface2::deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_deleteItem"); + TestInterface2V8Internal::deleteItemMethod(info); } void V8TestInterface2::namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_namedItem"); + TestInterface2V8Internal::namedItemMethod(info); } void V8TestInterface2::setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_setNamedItem"); + TestInterface2V8Internal::setNamedItemMethod(info); } void V8TestInterface2::deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_deleteNamedItem"); + TestInterface2V8Internal::deleteNamedItemMethod(info); } void V8TestInterface2::stringifierMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_stringifierMethod"); + TestInterface2V8Internal::stringifierMethodMethod(info); } void V8TestInterface2::keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_keys"); + TestInterface2V8Internal::keysMethod(info); } void V8TestInterface2::entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_entries"); + TestInterface2V8Internal::entriesMethod(info); } void V8TestInterface2::forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_forEach"); + TestInterface2V8Internal::forEachMethod(info); } void V8TestInterface2::hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_has"); + TestInterface2V8Internal::hasMethod(info); } void V8TestInterface2::toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_toString"); + TestInterface2V8Internal::toStringMethod(info); } void V8TestInterface2::iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_iterator"); + TestInterface2V8Internal::iteratorMethod(info); } void V8TestInterface2::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_NamedPropertyGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -574,6 +609,8 @@ } void V8TestInterface2::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_NamedPropertySetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -590,6 +627,8 @@ } void V8TestInterface2::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_NamedPropertyQuery"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -602,6 +641,8 @@ } void V8TestInterface2::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_IndexedPropertyGetter"); + TestInterface2V8Internal::indexedPropertyGetter(index, info); } @@ -660,6 +701,8 @@ }; void V8TestInterface2::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_Constructor"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestInterface2")); return;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp index 8b98dc63..5a289a9 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp
@@ -18,6 +18,7 @@ #include "bindings/core/v8/V8Document.h" #include "bindings/core/v8/V8Node.h" #include "core/dom/ExecutionContext.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -134,22 +135,32 @@ } // namespace TestInterface3V8Internal void V8TestInterface3::lengthAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface3_length_Getter"); + TestInterface3V8Internal::lengthAttributeGetter(info); } void V8TestInterface3::readonlyStringifierAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface3_readonlyStringifierAttribute_Getter"); + TestInterface3V8Internal::readonlyStringifierAttributeAttributeGetter(info); } void V8TestInterface3::voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface3_voidMethodDocument"); + TestInterface3V8Internal::voidMethodDocumentMethod(info); } void V8TestInterface3::toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface3_toString"); + TestInterface3V8Internal::toStringMethod(info); } void V8TestInterface3::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface3_NamedPropertyGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -158,6 +169,8 @@ } void V8TestInterface3::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface3_NamedPropertySetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -174,6 +187,8 @@ } void V8TestInterface3::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface3_NamedPropertyQuery"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -186,6 +201,8 @@ } void V8TestInterface3::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface3_IndexedPropertyGetter"); + V8TestInterface3::indexedPropertyGetterCustom(index, info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp index f17a47c..bf06681 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
@@ -19,6 +19,7 @@ #include "bindings/core/v8/V8DOMConfiguration.h" #include "core/dom/ExecutionContext.h" #include "core/frame/LocalDOMWindow.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -361,76 +362,112 @@ } // namespace TestInterfaceCheckSecurityV8Internal void V8TestInterfaceCheckSecurity::readonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_readonlyLongAttribute_Getter"); + TestInterfaceCheckSecurityV8Internal::readonlyLongAttributeAttributeGetter(info); } void V8TestInterfaceCheckSecurity::longAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_longAttribute_Getter"); + TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info); } void V8TestInterfaceCheckSecurity::longAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_longAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityLongAttribute_Getter"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeGetter(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityLongAttribute_Setter"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityReadonlyLongAttribute_Getter"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetter(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityOnSetterLongAttribute_Getter"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeGetter(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityOnSetterLongAttribute_Setter"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8Value, V8CrossOriginSetterInfo(info.GetIsolate(), info.Holder())); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityReplaceableReadonlyLongAttribute_Getter"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(info); } void V8TestInterfaceCheckSecurity::voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_voidMethod"); + TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityVoidMethod"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethod(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityVoidMethod_OriginSafeMethodGetter"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetter(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityPerWorldBindingsVoidMethod"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethod(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityPerWorldBindingsVoidMethod_OriginSafeMethodGetter"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityPerWorldBindingsVoidMethod"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityPerWorldBindingsVoidMethod_OriginSafeMethodGetter"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityUnforgeableVoidMethod"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethod(info); } void V8TestInterfaceCheckSecurity::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_doNotCheckSecurityUnforgeableVoidMethod_OriginSafeMethodGetter"); + TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(info); } @@ -443,6 +480,8 @@ } void V8TestInterfaceCheckSecurity::crossOriginNamedGetter(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_CrossOriginNamedGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -461,6 +500,8 @@ } void V8TestInterfaceCheckSecurity::crossOriginNamedSetter(v8::Local<v8::Name> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCheckSecurity_CrossOriginNamedSetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>());
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp index e021f5d8..b5a622f5 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
@@ -73,6 +73,8 @@ namespace TestInterfaceConstructorV8Internal { static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor_ConstructorCallback"); + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "TestInterfaceConstructor"); ScriptState* scriptState = ScriptState::From( info.NewTarget().As<v8::Object>()->CreationContext()); @@ -91,6 +93,8 @@ } static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor_ConstructorCallback"); + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "TestInterfaceConstructor"); ScriptState* scriptState = ScriptState::From( info.NewTarget().As<v8::Object>()->CreationContext()); @@ -170,6 +174,8 @@ } static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor_ConstructorCallback"); + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "TestInterfaceConstructor"); ScriptState* scriptState = ScriptState::From( info.NewTarget().As<v8::Object>()->CreationContext()); @@ -218,6 +224,8 @@ } static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor_ConstructorCallback"); + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "TestInterfaceConstructor"); ScriptState* scriptState = ScriptState::From( info.NewTarget().As<v8::Object>()->CreationContext()); @@ -332,6 +340,8 @@ #endif static void V8TestInterfaceConstructorConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor_ConstructorCallback"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("Audio")); return; @@ -413,6 +423,8 @@ void V8TestInterfaceConstructorConstructor::NamedConstructorAttributeGetter( v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor_NamedConstructorAttributeGetter"); + v8::Local<v8::Context> creationContext = info.Holder()->CreationContext(); V8PerContextData* perContextData = V8PerContextData::From(creationContext); if (!perContextData) { @@ -440,6 +452,8 @@ } void V8TestInterfaceConstructor::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor_Constructor"); + UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kTestFeature); if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestInterfaceConstructor"));
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp index d3142a49..cff7cf4 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
@@ -69,6 +69,8 @@ namespace TestInterfaceConstructor2V8Internal { static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor2_ConstructorCallback"); + V8StringResource<> stringArg; stringArg = info[0]; if (!stringArg.Prepare()) @@ -81,6 +83,8 @@ } static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor2_ConstructorCallback"); + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "TestInterfaceConstructor2"); Dictionary dictionaryArg; @@ -100,6 +104,8 @@ } static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor2_ConstructorCallback"); + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "TestInterfaceConstructor2"); Vector<Vector<String>> stringSequenceSequenceArg; @@ -114,6 +120,8 @@ } static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor2_ConstructorCallback"); + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "TestInterfaceConstructor2"); TestInterfaceEmpty* testInterfaceEmptyArg; @@ -233,6 +241,8 @@ } // namespace TestInterfaceConstructor2V8Internal void V8TestInterfaceConstructor2::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor2_Constructor"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestInterfaceConstructor2")); return;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp index d7d8ad0..1aef566 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp
@@ -67,6 +67,8 @@ namespace TestInterfaceConstructor3V8Internal { static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor3_ConstructorCallback"); + if (UNLIKELY(info.Length() < 1)) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToConstruct("TestInterfaceConstructor3", ExceptionMessages::NotEnoughArguments(1, info.Length()))); return; @@ -86,6 +88,8 @@ } // namespace TestInterfaceConstructor3V8Internal void V8TestInterfaceConstructor3::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor3_Constructor"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestInterfaceConstructor3")); return;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp index b3c3a42..1532d52f 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp
@@ -68,6 +68,8 @@ namespace TestInterfaceConstructor4V8Internal { static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor4_ConstructorCallback"); + TestInterfaceConstructor4* testInterface4Arg; testInterface4Arg = V8TestInterfaceConstructor4::toImplWithTypeCheck(info.GetIsolate(), info[0]); if (!testInterface4Arg) { @@ -83,6 +85,8 @@ } static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor4_ConstructorCallback"); + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "TestInterfaceConstructor4"); V8StringResource<> usvStringArg; @@ -119,6 +123,8 @@ } // namespace TestInterfaceConstructor4V8Internal void V8TestInterfaceConstructor4::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor4_Constructor"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestInterfaceConstructor4")); return;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp index fbcec51..cabab3b5 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp
@@ -67,6 +67,8 @@ } // namespace TestInterfaceCustomConstructorV8Internal void V8TestInterfaceCustomConstructor::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceCustomConstructor_Constructor"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestInterfaceCustomConstructor")); return;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp index 515a81c..a4e89f5 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
@@ -19,6 +19,7 @@ #include "core/fullscreen/DocumentFullscreen.h" #include "core/svg/SVGDocumentExtensions.h" #include "core/xml/DocumentXPathEvaluator.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -102,10 +103,14 @@ } // namespace TestInterfaceDocumentV8Internal void V8TestInterfaceDocument::locationAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceDocument_location_Getter"); + TestInterfaceDocumentV8Internal::locationAttributeGetter(info); } void V8TestInterfaceDocument::locationAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceDocument_location_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceDocumentV8Internal::locationAttributeSetter(v8Value, info);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp index 4b5ca15e..5abc8b34 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp
@@ -18,6 +18,7 @@ #include "bindings/core/v8/V8TestInterfaceEventInit.h" #include "core/dom/ExecutionContext.h" #include "core/frame/LocalDOMWindow.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -84,6 +85,8 @@ } static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceEventInitConstructor_ConstructorCallback"); + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "TestInterfaceEventInitConstructor"); if (UNLIKELY(info.Length() < 2)) { @@ -115,10 +118,14 @@ } // namespace TestInterfaceEventInitConstructorV8Internal void V8TestInterfaceEventInitConstructor::readonlyStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceEventInitConstructor_readonlyStringAttribute_Getter"); + TestInterfaceEventInitConstructorV8Internal::readonlyStringAttributeAttributeGetter(info); } void V8TestInterfaceEventInitConstructor::isTrustedAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceEventInitConstructor_isTrusted_Getter"); + TestInterfaceEventInitConstructorV8Internal::isTrustedAttributeGetter(info); } @@ -129,6 +136,8 @@ }; void V8TestInterfaceEventInitConstructor::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceEventInitConstructor_Constructor"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestInterfaceEventInitConstructor")); return;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp index 39f44468..59d1a77 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
@@ -92,6 +92,8 @@ #endif static void V8TestInterfaceEventTargetConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceEventTarget_ConstructorCallback"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("Name")); return; @@ -129,6 +131,8 @@ void V8TestInterfaceEventTargetConstructor::NamedConstructorAttributeGetter( v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceEventTarget_NamedConstructorAttributeGetter"); + v8::Local<v8::Context> creationContext = info.Holder()->CreationContext(); V8PerContextData* perContextData = V8PerContextData::From(creationContext); if (!perContextData) {
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp index 478501ff..a6a4f263 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
@@ -20,6 +20,7 @@ #include "bindings/core/v8/V8TestInterfaceGarbageCollected.h" #include "core/dom/ExecutionContext.h" #include "core/frame/LocalDOMWindow.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/ScriptState.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" @@ -285,6 +286,8 @@ } static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_ConstructorCallback"); + if (UNLIKELY(info.Length() < 1)) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToConstruct("TestInterfaceGarbageCollected", ExceptionMessages::NotEnoughArguments(1, info.Length()))); return; @@ -304,52 +307,76 @@ } // namespace TestInterfaceGarbageCollectedV8Internal void V8TestInterfaceGarbageCollected::attr1AttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_attr1_Getter"); + TestInterfaceGarbageCollectedV8Internal::attr1AttributeGetter(info); } void V8TestInterfaceGarbageCollected::attr1AttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_attr1_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info); } void V8TestInterfaceGarbageCollected::sizeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_size_Getter"); + TestInterfaceGarbageCollectedV8Internal::sizeAttributeGetter(info); } void V8TestInterfaceGarbageCollected::funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_func"); + TestInterfaceGarbageCollectedV8Internal::funcMethod(info); } void V8TestInterfaceGarbageCollected::keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_keys"); + TestInterfaceGarbageCollectedV8Internal::keysMethod(info); } void V8TestInterfaceGarbageCollected::entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_entries"); + TestInterfaceGarbageCollectedV8Internal::entriesMethod(info); } void V8TestInterfaceGarbageCollected::forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_forEach"); + TestInterfaceGarbageCollectedV8Internal::forEachMethod(info); } void V8TestInterfaceGarbageCollected::hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_has"); + TestInterfaceGarbageCollectedV8Internal::hasMethod(info); } void V8TestInterfaceGarbageCollected::addMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_add"); + TestInterfaceGarbageCollectedV8Internal::addMethod(info); } void V8TestInterfaceGarbageCollected::clearMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_clear"); + TestInterfaceGarbageCollectedV8Internal::clearMethod(info); } void V8TestInterfaceGarbageCollected::deleteMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_delete"); + TestInterfaceGarbageCollectedV8Internal::deleteMethod(info); } void V8TestInterfaceGarbageCollected::iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_iterator"); + TestInterfaceGarbageCollectedV8Internal::iteratorMethod(info); } @@ -371,6 +398,8 @@ }; void V8TestInterfaceGarbageCollected::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceGarbageCollected_Constructor"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestInterfaceGarbageCollected")); return;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp index 686a4221..972a67c7 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
@@ -18,6 +18,7 @@ #include "core/dom/Document.h" #include "core/dom/ExecutionContext.h" #include "core/frame/LocalDOMWindow.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/bindings/V8PrivateProperty.h" #include "platform/wtf/GetPtr.h" @@ -107,6 +108,8 @@ #endif static void V8TestInterfaceNamedConstructorConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNamedConstructor_ConstructorCallback"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("Audio")); return; @@ -205,6 +208,8 @@ void V8TestInterfaceNamedConstructorConstructor::NamedConstructorAttributeGetter( v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNamedConstructor_NamedConstructorAttributeGetter"); + v8::Local<v8::Context> creationContext = info.Holder()->CreationContext(); V8PerContextData* perContextData = V8PerContextData::From(creationContext); if (!perContextData) {
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp index d9edac2..de2645e 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp
@@ -93,6 +93,8 @@ #endif static void V8TestInterfaceNamedConstructor2ConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNamedConstructor2_ConstructorCallback"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("Audio")); return; @@ -138,6 +140,8 @@ void V8TestInterfaceNamedConstructor2Constructor::NamedConstructorAttributeGetter( v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNamedConstructor2_NamedConstructorAttributeGetter"); + v8::Local<v8::Context> creationContext = info.Holder()->CreationContext(); V8PerContextData* perContextData = V8PerContextData::From(creationContext); if (!perContextData) {
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp index 08149d1..573b905a 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
@@ -21,6 +21,7 @@ #include "core/HTMLNames.h" #include "core/dom/ExecutionContext.h" #include "core/html/custom/V0CustomElementProcessingStack.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -285,52 +286,74 @@ } // namespace TestInterfaceNodeV8Internal void V8TestInterfaceNode::nodeNameAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_nodeName_Getter"); + TestInterfaceNodeV8Internal::nodeNameAttributeGetter(info); } void V8TestInterfaceNode::nodeNameAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_nodeName_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceNodeV8Internal::nodeNameAttributeSetter(v8Value, info); } void V8TestInterfaceNode::stringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_stringAttribute_Getter"); + TestInterfaceNodeV8Internal::stringAttributeAttributeGetter(info); } void V8TestInterfaceNode::stringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_stringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceNodeV8Internal::stringAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceNode::readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_readonlyTestInterfaceEmptyAttribute_Getter"); + TestInterfaceNodeV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGetter(info); } void V8TestInterfaceNode::eventHandlerAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_eventHandlerAttribute_Getter"); + TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeGetter(info); } void V8TestInterfaceNode::eventHandlerAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_eventHandlerAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceNode::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_perWorldBindingsReadonlyTestInterfaceEmptyAttribute_Getter"); + TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(info); } void V8TestInterfaceNode::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_perWorldBindingsReadonlyTestInterfaceEmptyAttribute_Getter"); + TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterForMainWorld(info); } void V8TestInterfaceNode::reflectStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_reflectStringAttribute_Getter"); + TestInterfaceNodeV8Internal::reflectStringAttributeAttributeGetter(info); } void V8TestInterfaceNode::reflectStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_reflectStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -339,10 +362,14 @@ } void V8TestInterfaceNode::reflectUrlStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_reflectUrlStringAttribute_Getter"); + TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeGetter(info); } void V8TestInterfaceNode::reflectUrlStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_reflectUrlStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -351,22 +378,32 @@ } void V8TestInterfaceNode::testInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_testInterfaceEmptyMethod"); + TestInterfaceNodeV8Internal::testInterfaceEmptyMethodMethod(info); } void V8TestInterfaceNode::perWorldBindingsTestInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_perWorldBindingsTestInterfaceEmptyMethod"); + TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodMethod(info); } void V8TestInterfaceNode::perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_perWorldBindingsTestInterfaceEmptyMethod"); + TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodMethodForMainWorld(info); } void V8TestInterfaceNode::perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg"); + TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod(info); } void V8TestInterfaceNode::perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceNode_perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg"); + TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodForMainWorld(info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp index 6c6d59f8..2e46618 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
@@ -17,6 +17,7 @@ #include "bindings/core/v8/V8DOMConfiguration.h" #include "core/dom/ExecutionContext.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -222,48 +223,68 @@ } // namespace TestInterfaceOriginTrialEnabledV8Internal void V8TestInterfaceOriginTrialEnabled::doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceOriginTrialEnabled_doubleAttribute_Getter"); + TestInterfaceOriginTrialEnabledV8Internal::doubleAttributeAttributeGetter(info); } void V8TestInterfaceOriginTrialEnabled::doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceOriginTrialEnabled_doubleAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceOriginTrialEnabledV8Internal::doubleAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceOriginTrialEnabled::conditionalLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceOriginTrialEnabled_conditionalLongAttribute_Getter"); + TestInterfaceOriginTrialEnabledV8Internal::conditionalLongAttributeAttributeGetter(info); } void V8TestInterfaceOriginTrialEnabled::conditionalLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceOriginTrialEnabled_conditionalLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceOriginTrialEnabledV8Internal::conditionalLongAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceOriginTrialEnabled::conditionalReadOnlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceOriginTrialEnabled_conditionalReadOnlyLongAttribute_Getter"); + TestInterfaceOriginTrialEnabledV8Internal::conditionalReadOnlyLongAttributeAttributeGetter(info); } void V8TestInterfaceOriginTrialEnabled::staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceOriginTrialEnabled_staticStringAttribute_Getter"); + TestInterfaceOriginTrialEnabledV8Internal::staticStringAttributeAttributeGetter(info); } void V8TestInterfaceOriginTrialEnabled::staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceOriginTrialEnabled_staticStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceOriginTrialEnabledV8Internal::staticStringAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceOriginTrialEnabled::staticConditionalReadOnlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceOriginTrialEnabled_staticConditionalReadOnlyLongAttribute_Getter"); + TestInterfaceOriginTrialEnabledV8Internal::staticConditionalReadOnlyLongAttributeAttributeGetter(info); } void V8TestInterfaceOriginTrialEnabled::voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceOriginTrialEnabled_voidMethodDoubleArgFloatArg"); + TestInterfaceOriginTrialEnabledV8Internal::voidMethodDoubleArgFloatArgMethod(info); } void V8TestInterfaceOriginTrialEnabled::voidMethodPartialOverloadMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceOriginTrialEnabled_voidMethodPartialOverload"); + TestInterfaceOriginTrialEnabledV8Internal::voidMethodPartialOverloadMethod(info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp index 22f45233..2c1a856 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp
@@ -17,6 +17,7 @@ #include "bindings/core/v8/V8DOMConfiguration.h" #include "core/dom/ExecutionContext.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -291,86 +292,122 @@ } // namespace TestInterfaceSecureContextV8Internal void V8TestInterfaceSecureContext::secureContextAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextAttribute_Getter"); + TestInterfaceSecureContextV8Internal::secureContextAttributeAttributeGetter(info); } void V8TestInterfaceSecureContext::secureContextAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceSecureContextV8Internal::secureContextAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceSecureContext::secureContextRuntimeEnabledAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextRuntimeEnabledAttribute_Getter"); + TestInterfaceSecureContextV8Internal::secureContextRuntimeEnabledAttributeAttributeGetter(info); } void V8TestInterfaceSecureContext::secureContextRuntimeEnabledAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextRuntimeEnabledAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceSecureContextV8Internal::secureContextRuntimeEnabledAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceSecureContext::secureContextWindowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWindowExposedAttribute_Getter"); + TestInterfaceSecureContextV8Internal::secureContextWindowExposedAttributeAttributeGetter(info); } void V8TestInterfaceSecureContext::secureContextWindowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWindowExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceSecureContextV8Internal::secureContextWindowExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceSecureContext::secureContextWorkerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWorkerExposedAttribute_Getter"); + TestInterfaceSecureContextV8Internal::secureContextWorkerExposedAttributeAttributeGetter(info); } void V8TestInterfaceSecureContext::secureContextWorkerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWorkerExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceSecureContextV8Internal::secureContextWorkerExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceSecureContext::secureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWindowExposedRuntimeEnabledAttribute_Getter"); + TestInterfaceSecureContextV8Internal::secureContextWindowExposedRuntimeEnabledAttributeAttributeGetter(info); } void V8TestInterfaceSecureContext::secureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWindowExposedRuntimeEnabledAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceSecureContextV8Internal::secureContextWindowExposedRuntimeEnabledAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceSecureContext::secureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWorkerExposedRuntimeEnabledAttribute_Getter"); + TestInterfaceSecureContextV8Internal::secureContextWorkerExposedRuntimeEnabledAttributeAttributeGetter(info); } void V8TestInterfaceSecureContext::secureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWorkerExposedRuntimeEnabledAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceSecureContextV8Internal::secureContextWorkerExposedRuntimeEnabledAttributeAttributeSetter(v8Value, info); } void V8TestInterfaceSecureContext::secureContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextMethod"); + TestInterfaceSecureContextV8Internal::secureContextMethodMethod(info); } void V8TestInterfaceSecureContext::secureContextRuntimeEnabledMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextRuntimeEnabledMethod"); + TestInterfaceSecureContextV8Internal::secureContextRuntimeEnabledMethodMethod(info); } void V8TestInterfaceSecureContext::secureContextWindowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWindowExposedMethod"); + TestInterfaceSecureContextV8Internal::secureContextWindowExposedMethodMethod(info); } void V8TestInterfaceSecureContext::secureContextWorkerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWorkerExposedMethod"); + TestInterfaceSecureContextV8Internal::secureContextWorkerExposedMethodMethod(info); } void V8TestInterfaceSecureContext::secureContextWindowExposedRuntimeEnabledMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWindowExposedRuntimeEnabledMethod"); + TestInterfaceSecureContextV8Internal::secureContextWindowExposedRuntimeEnabledMethodMethod(info); } void V8TestInterfaceSecureContext::secureContextWorkerExposedRuntimeEnabledMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceSecureContext_secureContextWorkerExposedRuntimeEnabledMethod"); + TestInterfaceSecureContextV8Internal::secureContextWorkerExposedRuntimeEnabledMethodMethod(info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp index c66fa71..90cfd355 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp
@@ -17,6 +17,7 @@ #include "bindings/core/v8/V8DOMConfiguration.h" #include "core/dom/ExecutionContext.h" #include "core/frame/LocalDOMWindow.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -173,6 +174,8 @@ } static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestNode_ConstructorCallback"); + TestNode* impl = TestNode::Create(); v8::Local<v8::Object> wrapper = info.Holder(); wrapper = impl->AssociateWithWrapper(info.GetIsolate(), &V8TestNode::wrapperTypeInfo, wrapper); @@ -182,40 +185,56 @@ } // namespace TestNodeV8Internal void V8TestNode::hrefAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestNode_href_Getter"); + TestNodeV8Internal::hrefAttributeGetter(info); } void V8TestNode::hrefAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestNode_href_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestNodeV8Internal::hrefAttributeSetter(v8Value, info); } void V8TestNode::hrefThrowsAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestNode_hrefThrows_Getter"); + TestNodeV8Internal::hrefThrowsAttributeGetter(info); } void V8TestNode::hrefThrowsAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestNode_hrefThrows_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestNodeV8Internal::hrefThrowsAttributeSetter(v8Value, info); } void V8TestNode::hrefCallWithAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestNode_hrefCallWith_Getter"); + TestNodeV8Internal::hrefCallWithAttributeGetter(info); } void V8TestNode::hrefCallWithAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestNode_hrefCallWith_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestNodeV8Internal::hrefCallWithAttributeSetter(v8Value, info); } void V8TestNode::hrefByteStringAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestNode_hrefByteString_Getter"); + TestNodeV8Internal::hrefByteStringAttributeGetter(info); } void V8TestNode::hrefByteStringAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestNode_hrefByteString_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestNodeV8Internal::hrefByteStringAttributeSetter(v8Value, info); @@ -232,6 +251,8 @@ }; void V8TestNode::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestNode_Constructor"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestNode")); return;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp index 4748e12..b1be1571 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -9582,642 +9582,902 @@ } // namespace TestObjectV8Internal void V8TestObject::stringifierAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringifierAttribute_Getter"); + TestObjectV8Internal::stringifierAttributeAttributeGetter(info); } void V8TestObject::stringifierAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringifierAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::stringifierAttributeAttributeSetter(v8Value, info); } void V8TestObject::readonlyStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_readonlyStringAttribute_Getter"); + TestObjectV8Internal::readonlyStringAttributeAttributeGetter(info); } void V8TestObject::readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_readonlyTestInterfaceEmptyAttribute_Getter"); + TestObjectV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGetter(info); } void V8TestObject::readonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_readonlyLongAttribute_Getter"); + TestObjectV8Internal::readonlyLongAttributeAttributeGetter(info); } void V8TestObject::dateAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_dateAttribute_Getter"); + TestObjectV8Internal::dateAttributeAttributeGetter(info); } void V8TestObject::dateAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_dateAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::dateAttributeAttributeSetter(v8Value, info); } void V8TestObject::stringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringAttribute_Getter"); + TestObjectV8Internal::stringAttributeAttributeGetter(info); } void V8TestObject::stringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::stringAttributeAttributeSetter(v8Value, info); } void V8TestObject::byteStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_byteStringAttribute_Getter"); + TestObjectV8Internal::byteStringAttributeAttributeGetter(info); } void V8TestObject::byteStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_byteStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::byteStringAttributeAttributeSetter(v8Value, info); } void V8TestObject::usvStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_usvStringAttribute_Getter"); + TestObjectV8Internal::usvStringAttributeAttributeGetter(info); } void V8TestObject::usvStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_usvStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::usvStringAttributeAttributeSetter(v8Value, info); } void V8TestObject::domTimeStampAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_domTimeStampAttribute_Getter"); + TestObjectV8Internal::domTimeStampAttributeAttributeGetter(info); } void V8TestObject::domTimeStampAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_domTimeStampAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::domTimeStampAttributeAttributeSetter(v8Value, info); } void V8TestObject::booleanAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_booleanAttribute_Getter"); + TestObjectV8Internal::booleanAttributeAttributeGetter(info); } void V8TestObject::booleanAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_booleanAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::booleanAttributeAttributeSetter(v8Value, info); } void V8TestObject::byteAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_byteAttribute_Getter"); + TestObjectV8Internal::byteAttributeAttributeGetter(info); } void V8TestObject::byteAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_byteAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::byteAttributeAttributeSetter(v8Value, info); } void V8TestObject::doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_doubleAttribute_Getter"); + TestObjectV8Internal::doubleAttributeAttributeGetter(info); } void V8TestObject::doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_doubleAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::doubleAttributeAttributeSetter(v8Value, info); } void V8TestObject::floatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_floatAttribute_Getter"); + TestObjectV8Internal::floatAttributeAttributeGetter(info); } void V8TestObject::floatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_floatAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::floatAttributeAttributeSetter(v8Value, info); } void V8TestObject::longAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longAttribute_Getter"); + TestObjectV8Internal::longAttributeAttributeGetter(info); } void V8TestObject::longAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::longAttributeAttributeSetter(v8Value, info); } void V8TestObject::longLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longLongAttribute_Getter"); + TestObjectV8Internal::longLongAttributeAttributeGetter(info); } void V8TestObject::longLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::longLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::octetAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_octetAttribute_Getter"); + TestObjectV8Internal::octetAttributeAttributeGetter(info); } void V8TestObject::octetAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_octetAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::octetAttributeAttributeSetter(v8Value, info); } void V8TestObject::shortAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_shortAttribute_Getter"); + TestObjectV8Internal::shortAttributeAttributeGetter(info); } void V8TestObject::shortAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_shortAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::shortAttributeAttributeSetter(v8Value, info); } void V8TestObject::unrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unrestrictedDoubleAttribute_Getter"); + TestObjectV8Internal::unrestrictedDoubleAttributeAttributeGetter(info); } void V8TestObject::unrestrictedDoubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unrestrictedDoubleAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::unrestrictedDoubleAttributeAttributeSetter(v8Value, info); } void V8TestObject::unrestrictedFloatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unrestrictedFloatAttribute_Getter"); + TestObjectV8Internal::unrestrictedFloatAttributeAttributeGetter(info); } void V8TestObject::unrestrictedFloatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unrestrictedFloatAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::unrestrictedFloatAttributeAttributeSetter(v8Value, info); } void V8TestObject::unsignedLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unsignedLongAttribute_Getter"); + TestObjectV8Internal::unsignedLongAttributeAttributeGetter(info); } void V8TestObject::unsignedLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unsignedLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::unsignedLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::unsignedLongLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unsignedLongLongAttribute_Getter"); + TestObjectV8Internal::unsignedLongLongAttributeAttributeGetter(info); } void V8TestObject::unsignedLongLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unsignedLongLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::unsignedLongLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::unsignedShortAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unsignedShortAttribute_Getter"); + TestObjectV8Internal::unsignedShortAttributeAttributeGetter(info); } void V8TestObject::unsignedShortAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unsignedShortAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::unsignedShortAttributeAttributeSetter(v8Value, info); } void V8TestObject::testInterfaceEmptyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptyAttribute_Getter"); + TestObjectV8Internal::testInterfaceEmptyAttributeAttributeGetter(info); } void V8TestObject::testInterfaceEmptyAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptyAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testInterfaceEmptyAttributeAttributeSetter(v8Value, info); } void V8TestObject::testObjectAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testObjectAttribute_Getter"); + TestObjectV8Internal::testObjectAttributeAttributeGetter(info); } void V8TestObject::testObjectAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testObjectAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testObjectAttributeAttributeSetter(v8Value, info); } void V8TestObject::cssAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cssAttribute_Getter"); + TestObjectV8Internal::cssAttributeAttributeGetter(info); } void V8TestObject::cssAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cssAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::cssAttributeAttributeSetter(v8Value, info); } void V8TestObject::imeAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_imeAttribute_Getter"); + TestObjectV8Internal::imeAttributeAttributeGetter(info); } void V8TestObject::imeAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_imeAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::imeAttributeAttributeSetter(v8Value, info); } void V8TestObject::svgAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_svgAttribute_Getter"); + TestObjectV8Internal::svgAttributeAttributeGetter(info); } void V8TestObject::svgAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_svgAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::svgAttributeAttributeSetter(v8Value, info); } void V8TestObject::xmlAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_xmlAttribute_Getter"); + TestObjectV8Internal::xmlAttributeAttributeGetter(info); } void V8TestObject::xmlAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_xmlAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::xmlAttributeAttributeSetter(v8Value, info); } void V8TestObject::nodeFilterAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nodeFilterAttribute_Getter"); + TestObjectV8Internal::nodeFilterAttributeAttributeGetter(info); } void V8TestObject::nodeFilterAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nodeFilterAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::nodeFilterAttributeAttributeSetter(v8Value, info); } void V8TestObject::serializedScriptValueAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_serializedScriptValueAttribute_Getter"); + TestObjectV8Internal::serializedScriptValueAttributeAttributeGetter(info); } void V8TestObject::serializedScriptValueAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_serializedScriptValueAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::serializedScriptValueAttributeAttributeSetter(v8Value, info); } void V8TestObject::anyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_anyAttribute_Getter"); + TestObjectV8Internal::anyAttributeAttributeGetter(info); } void V8TestObject::anyAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_anyAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::anyAttributeAttributeSetter(v8Value, info); } void V8TestObject::promiseAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_promiseAttribute_Getter"); + TestObjectV8Internal::promiseAttributeAttributeGetter(info); } void V8TestObject::promiseAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_promiseAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::promiseAttributeAttributeSetter(v8Value, info); } void V8TestObject::windowAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_windowAttribute_Getter"); + TestObjectV8Internal::windowAttributeAttributeGetter(info); } void V8TestObject::windowAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_windowAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::windowAttributeAttributeSetter(v8Value, info); } void V8TestObject::documentAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_documentAttribute_Getter"); + TestObjectV8Internal::documentAttributeAttributeGetter(info); } void V8TestObject::documentAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_documentAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::documentAttributeAttributeSetter(v8Value, info); } void V8TestObject::documentFragmentAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_documentFragmentAttribute_Getter"); + TestObjectV8Internal::documentFragmentAttributeAttributeGetter(info); } void V8TestObject::documentFragmentAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_documentFragmentAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::documentFragmentAttributeAttributeSetter(v8Value, info); } void V8TestObject::documentTypeAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_documentTypeAttribute_Getter"); + TestObjectV8Internal::documentTypeAttributeAttributeGetter(info); } void V8TestObject::documentTypeAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_documentTypeAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::documentTypeAttributeAttributeSetter(v8Value, info); } void V8TestObject::elementAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_elementAttribute_Getter"); + TestObjectV8Internal::elementAttributeAttributeGetter(info); } void V8TestObject::elementAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_elementAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::elementAttributeAttributeSetter(v8Value, info); } void V8TestObject::nodeAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nodeAttribute_Getter"); + TestObjectV8Internal::nodeAttributeAttributeGetter(info); } void V8TestObject::nodeAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nodeAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::nodeAttributeAttributeSetter(v8Value, info); } void V8TestObject::shadowRootAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_shadowRootAttribute_Getter"); + TestObjectV8Internal::shadowRootAttributeAttributeGetter(info); } void V8TestObject::shadowRootAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_shadowRootAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::shadowRootAttributeAttributeSetter(v8Value, info); } void V8TestObject::arrayBufferAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_arrayBufferAttribute_Getter"); + TestObjectV8Internal::arrayBufferAttributeAttributeGetter(info); } void V8TestObject::arrayBufferAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_arrayBufferAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::arrayBufferAttributeAttributeSetter(v8Value, info); } void V8TestObject::float32ArrayAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_float32ArrayAttribute_Getter"); + TestObjectV8Internal::float32ArrayAttributeAttributeGetter(info); } void V8TestObject::float32ArrayAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_float32ArrayAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::float32ArrayAttributeAttributeSetter(v8Value, info); } void V8TestObject::uint8ArrayAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_uint8ArrayAttribute_Getter"); + TestObjectV8Internal::uint8ArrayAttributeAttributeGetter(info); } void V8TestObject::uint8ArrayAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_uint8ArrayAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::uint8ArrayAttributeAttributeSetter(v8Value, info); } void V8TestObject::selfAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_self_Getter"); + TestObjectV8Internal::selfAttributeGetter(info); } void V8TestObject::readonlyEventTargetAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_readonlyEventTargetAttribute_Getter"); + TestObjectV8Internal::readonlyEventTargetAttributeAttributeGetter(info); } void V8TestObject::readonlyEventTargetOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_readonlyEventTargetOrNullAttribute_Getter"); + TestObjectV8Internal::readonlyEventTargetOrNullAttributeAttributeGetter(info); } void V8TestObject::readonlyWindowAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_readonlyWindowAttribute_Getter"); + TestObjectV8Internal::readonlyWindowAttributeAttributeGetter(info); } void V8TestObject::htmlCollectionAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_htmlCollectionAttribute_Getter"); + TestObjectV8Internal::htmlCollectionAttributeAttributeGetter(info); } void V8TestObject::htmlElementAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_htmlElementAttribute_Getter"); + TestObjectV8Internal::htmlElementAttributeAttributeGetter(info); } void V8TestObject::stringArrayAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringArrayAttribute_Getter"); + TestObjectV8Internal::stringArrayAttributeAttributeGetter(info); } void V8TestObject::stringArrayAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringArrayAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::stringArrayAttributeAttributeSetter(v8Value, info); } void V8TestObject::testInterfaceEmptyArrayAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptyArrayAttribute_Getter"); + TestObjectV8Internal::testInterfaceEmptyArrayAttributeAttributeGetter(info); } void V8TestObject::testInterfaceEmptyArrayAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptyArrayAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testInterfaceEmptyArrayAttributeAttributeSetter(v8Value, info); } void V8TestObject::floatArrayAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_floatArrayAttribute_Getter"); + TestObjectV8Internal::floatArrayAttributeAttributeGetter(info); } void V8TestObject::floatArrayAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_floatArrayAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::floatArrayAttributeAttributeSetter(v8Value, info); } void V8TestObject::stringFrozenArrayAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringFrozenArrayAttribute_Getter"); + TestObjectV8Internal::stringFrozenArrayAttributeAttributeGetter(info); } void V8TestObject::stringFrozenArrayAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringFrozenArrayAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::stringFrozenArrayAttributeAttributeSetter(v8Value, info); } void V8TestObject::testInterfaceEmptyFrozenArrayAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptyFrozenArrayAttribute_Getter"); + TestObjectV8Internal::testInterfaceEmptyFrozenArrayAttributeAttributeGetter(info); } void V8TestObject::testInterfaceEmptyFrozenArrayAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptyFrozenArrayAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testInterfaceEmptyFrozenArrayAttributeAttributeSetter(v8Value, info); } void V8TestObject::booleanOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_booleanOrNullAttribute_Getter"); + TestObjectV8Internal::booleanOrNullAttributeAttributeGetter(info); } void V8TestObject::booleanOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_booleanOrNullAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::booleanOrNullAttributeAttributeSetter(v8Value, info); } void V8TestObject::stringOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringOrNullAttribute_Getter"); + TestObjectV8Internal::stringOrNullAttributeAttributeGetter(info); } void V8TestObject::stringOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringOrNullAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::stringOrNullAttributeAttributeSetter(v8Value, info); } void V8TestObject::longOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longOrNullAttribute_Getter"); + TestObjectV8Internal::longOrNullAttributeAttributeGetter(info); } void V8TestObject::longOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longOrNullAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::longOrNullAttributeAttributeSetter(v8Value, info); } void V8TestObject::testInterfaceOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceOrNullAttribute_Getter"); + TestObjectV8Internal::testInterfaceOrNullAttributeAttributeGetter(info); } void V8TestObject::testInterfaceOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceOrNullAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testInterfaceOrNullAttributeAttributeSetter(v8Value, info); } void V8TestObject::testEnumAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testEnumAttribute_Getter"); + TestObjectV8Internal::testEnumAttributeAttributeGetter(info); } void V8TestObject::testEnumAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testEnumAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testEnumAttributeAttributeSetter(v8Value, info); } void V8TestObject::testEnumOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testEnumOrNullAttribute_Getter"); + TestObjectV8Internal::testEnumOrNullAttributeAttributeGetter(info); } void V8TestObject::testEnumOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testEnumOrNullAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testEnumOrNullAttributeAttributeSetter(v8Value, info); } void V8TestObject::staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_staticStringAttribute_Getter"); + TestObjectV8Internal::staticStringAttributeAttributeGetter(info); } void V8TestObject::staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_staticStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::staticStringAttributeAttributeSetter(v8Value, info); } void V8TestObject::staticLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_staticLongAttribute_Getter"); + TestObjectV8Internal::staticLongAttributeAttributeGetter(info); } void V8TestObject::staticLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_staticLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::staticLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::eventHandlerAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_eventHandlerAttribute_Getter"); + TestObjectV8Internal::eventHandlerAttributeAttributeGetter(info); } void V8TestObject::eventHandlerAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_eventHandlerAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::eventHandlerAttributeAttributeSetter(v8Value, info); } void V8TestObject::doubleOrStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_doubleOrStringAttribute_Getter"); + TestObjectV8Internal::doubleOrStringAttributeAttributeGetter(info); } void V8TestObject::doubleOrStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_doubleOrStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::doubleOrStringAttributeAttributeSetter(v8Value, info); } void V8TestObject::doubleOrStringOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_doubleOrStringOrNullAttribute_Getter"); + TestObjectV8Internal::doubleOrStringOrNullAttributeAttributeGetter(info); } void V8TestObject::doubleOrStringOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_doubleOrStringOrNullAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::doubleOrStringOrNullAttributeAttributeSetter(v8Value, info); } void V8TestObject::doubleOrNullStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_doubleOrNullStringAttribute_Getter"); + TestObjectV8Internal::doubleOrNullStringAttributeAttributeGetter(info); } void V8TestObject::doubleOrNullStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_doubleOrNullStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::doubleOrNullStringAttributeAttributeSetter(v8Value, info); } void V8TestObject::stringOrStringSequenceAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringOrStringSequenceAttribute_Getter"); + TestObjectV8Internal::stringOrStringSequenceAttributeAttributeGetter(info); } void V8TestObject::stringOrStringSequenceAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringOrStringSequenceAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::stringOrStringSequenceAttributeAttributeSetter(v8Value, info); } void V8TestObject::testEnumOrDoubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testEnumOrDoubleAttribute_Getter"); + TestObjectV8Internal::testEnumOrDoubleAttributeAttributeGetter(info); } void V8TestObject::testEnumOrDoubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testEnumOrDoubleAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testEnumOrDoubleAttributeAttributeSetter(v8Value, info); } void V8TestObject::unrestrictedDoubleOrStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unrestrictedDoubleOrStringAttribute_Getter"); + TestObjectV8Internal::unrestrictedDoubleOrStringAttributeAttributeGetter(info); } void V8TestObject::unrestrictedDoubleOrStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unrestrictedDoubleOrStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::unrestrictedDoubleOrStringAttributeAttributeSetter(v8Value, info); } void V8TestObject::nestedUnionAtributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nestedUnionAtribute_Getter"); + TestObjectV8Internal::nestedUnionAtributeAttributeGetter(info); } void V8TestObject::nestedUnionAtributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nestedUnionAtribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::nestedUnionAtributeAttributeSetter(v8Value, info); } void V8TestObject::activityLoggingAccessForAllWorldsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessForAllWorldsLongAttribute_Getter"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -10228,6 +10488,8 @@ } void V8TestObject::activityLoggingAccessForAllWorldsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessForAllWorldsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; ScriptState* scriptState = ScriptState::ForRelevantRealm(info); @@ -10240,6 +10502,8 @@ } void V8TestObject::activityLoggingGetterForAllWorldsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingGetterForAllWorldsLongAttribute_Getter"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -10250,16 +10514,22 @@ } void V8TestObject::activityLoggingGetterForAllWorldsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingGetterForAllWorldsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::activityLoggingGetterForAllWorldsLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::activityLoggingSetterForAllWorldsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingSetterForAllWorldsLongAttribute_Getter"); + TestObjectV8Internal::activityLoggingSetterForAllWorldsLongAttributeAttributeGetter(info); } void V8TestObject::activityLoggingSetterForAllWorldsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingSetterForAllWorldsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; ScriptState* scriptState = ScriptState::ForRelevantRealm(info); @@ -10272,122 +10542,170 @@ } void V8TestObject::cachedAttributeAnyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cachedAttributeAnyAttribute_Getter"); + TestObjectV8Internal::cachedAttributeAnyAttributeAttributeGetter(info); } void V8TestObject::cachedAttributeAnyAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cachedAttributeAnyAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::cachedAttributeAnyAttributeAttributeSetter(v8Value, info); } void V8TestObject::cachedArrayAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cachedArrayAttribute_Getter"); + TestObjectV8Internal::cachedArrayAttributeAttributeGetter(info); } void V8TestObject::cachedArrayAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cachedArrayAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::cachedArrayAttributeAttributeSetter(v8Value, info); } void V8TestObject::cachedStringOrNoneAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cachedStringOrNoneAttribute_Getter"); + TestObjectV8Internal::cachedStringOrNoneAttributeAttributeGetter(info); } void V8TestObject::cachedStringOrNoneAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cachedStringOrNoneAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::cachedStringOrNoneAttributeAttributeSetter(v8Value, info); } void V8TestObject::callWithExecutionContextAnyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithExecutionContextAnyAttribute_Getter"); + TestObjectV8Internal::callWithExecutionContextAnyAttributeAttributeGetter(info); } void V8TestObject::callWithExecutionContextAnyAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithExecutionContextAnyAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::callWithExecutionContextAnyAttributeAttributeSetter(v8Value, info); } void V8TestObject::callWithScriptStateAnyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithScriptStateAnyAttribute_Getter"); + TestObjectV8Internal::callWithScriptStateAnyAttributeAttributeGetter(info); } void V8TestObject::callWithScriptStateAnyAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithScriptStateAnyAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::callWithScriptStateAnyAttributeAttributeSetter(v8Value, info); } void V8TestObject::callWithExecutionContextAndScriptStateAnyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithExecutionContextAndScriptStateAnyAttribute_Getter"); + TestObjectV8Internal::callWithExecutionContextAndScriptStateAnyAttributeAttributeGetter(info); } void V8TestObject::callWithExecutionContextAndScriptStateAnyAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithExecutionContextAndScriptStateAnyAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::callWithExecutionContextAndScriptStateAnyAttributeAttributeSetter(v8Value, info); } void V8TestObject::checkSecurityForNodeReadonlyDocumentAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_checkSecurityForNodeReadonlyDocumentAttribute_Getter"); + TestObjectV8Internal::checkSecurityForNodeReadonlyDocumentAttributeAttributeGetter(info); } void V8TestObject::testInterfaceEmptyConstructorAttributeConstructorGetterCallback(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptyConstructorAttribute_ConstructorGetterCallback"); + Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), WebFeature::kdeprecatedTestInterfaceEmptyConstructorAttribute); V8ConstructorAttributeGetter(property, info); } void V8TestObject::measureAsFeatureNameTestInterfaceEmptyConstructorAttributeConstructorGetterCallback(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_measureAsFeatureNameTestInterfaceEmptyConstructorAttribute_ConstructorGetterCallback"); + UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kFeatureName); V8ConstructorAttributeGetter(property, info); } void V8TestObject::customObjectAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customObjectAttribute_Getter"); + V8TestObject::customObjectAttributeAttributeGetterCustom(info); } void V8TestObject::customObjectAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customObjectAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V8TestObject::customObjectAttributeAttributeSetterCustom(v8Value, info); } void V8TestObject::customGetterLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customGetterLongAttribute_Getter"); + V8TestObject::customGetterLongAttributeAttributeGetterCustom(info); } void V8TestObject::customGetterLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customGetterLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::customGetterLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::customGetterReadonlyObjectAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customGetterReadonlyObjectAttribute_Getter"); + V8TestObject::customGetterReadonlyObjectAttributeAttributeGetterCustom(info); } void V8TestObject::customSetterLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customSetterLongAttribute_Getter"); + TestObjectV8Internal::customSetterLongAttributeAttributeGetter(info); } void V8TestObject::customSetterLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customSetterLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V8TestObject::customSetterLongAttributeAttributeSetterCustom(v8Value, info); } void V8TestObject::deprecatedLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_deprecatedLongAttribute_Getter"); + Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), WebFeature::kLongAttribute); TestObjectV8Internal::deprecatedLongAttributeAttributeGetter(info); } void V8TestObject::deprecatedLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_deprecatedLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), WebFeature::kLongAttribute); @@ -10396,62 +10714,86 @@ } void V8TestObject::enforceRangeLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_enforceRangeLongAttribute_Getter"); + TestObjectV8Internal::enforceRangeLongAttributeAttributeGetter(info); } void V8TestObject::enforceRangeLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_enforceRangeLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::enforceRangeLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::implementedAsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_implementedAsLongAttribute_Getter"); + TestObjectV8Internal::implementedAsLongAttributeAttributeGetter(info); } void V8TestObject::implementedAsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_implementedAsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::implementedAsLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::customImplementedAsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customImplementedAsLongAttribute_Getter"); + V8TestObject::customImplementedAsLongAttributeAttributeGetterCustom(info); } void V8TestObject::customImplementedAsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customImplementedAsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V8TestObject::customImplementedAsLongAttributeAttributeSetterCustom(v8Value, info); } void V8TestObject::customGetterImplementedAsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customGetterImplementedAsLongAttribute_Getter"); + V8TestObject::customGetterImplementedAsLongAttributeAttributeGetterCustom(info); } void V8TestObject::customGetterImplementedAsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customGetterImplementedAsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::customGetterImplementedAsLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::customSetterImplementedAsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customSetterImplementedAsLongAttribute_Getter"); + TestObjectV8Internal::customSetterImplementedAsLongAttributeAttributeGetter(info); } void V8TestObject::customSetterImplementedAsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customSetterImplementedAsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V8TestObject::customSetterImplementedAsLongAttributeAttributeSetterCustom(v8Value, info); } void V8TestObject::measureAsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_measureAsLongAttribute_Getter"); + UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kTestFeature); TestObjectV8Internal::measureAsLongAttributeAttributeGetter(info); } void V8TestObject::measureAsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_measureAsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kTestFeature); @@ -10460,34 +10802,48 @@ } void V8TestObject::notEnumerableLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_notEnumerableLongAttribute_Getter"); + TestObjectV8Internal::notEnumerableLongAttributeAttributeGetter(info); } void V8TestObject::notEnumerableLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_notEnumerableLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::notEnumerableLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::originTrialEnabledLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_originTrialEnabledLongAttribute_Getter"); + TestObjectV8Internal::originTrialEnabledLongAttributeAttributeGetter(info); } void V8TestObject::originTrialEnabledLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_originTrialEnabledLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::originTrialEnabledLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsReadonlyTestInterfaceEmptyAttribute_Getter"); + TestObjectV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(info); } void V8TestObject::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsReadonlyTestInterfaceEmptyAttribute_Getter"); + TestObjectV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterForMainWorld(info); } void V8TestObject::activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessPerWorldBindingsLongAttribute_Getter"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -10498,6 +10854,8 @@ } void V8TestObject::activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessPerWorldBindingsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; ScriptState* scriptState = ScriptState::ForRelevantRealm(info); @@ -10510,6 +10868,8 @@ } void V8TestObject::activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessPerWorldBindingsLongAttribute_Getter"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -10520,6 +10880,8 @@ } void V8TestObject::activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessPerWorldBindingsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; ScriptState* scriptState = ScriptState::ForRelevantRealm(info); @@ -10532,6 +10894,8 @@ } void V8TestObject::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute_Getter"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -10542,6 +10906,8 @@ } void V8TestObject::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; ScriptState* scriptState = ScriptState::ForRelevantRealm(info); @@ -10554,16 +10920,22 @@ } void V8TestObject::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute_Getter"); + TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(info); } void V8TestObject::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); } void V8TestObject::activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingGetterPerWorldBindingsLongAttribute_Getter"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -10574,12 +10946,16 @@ } void V8TestObject::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingGetterPerWorldBindingsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingGetterPerWorldBindingsLongAttribute_Getter"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -10590,12 +10966,16 @@ } void V8TestObject::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingGetterPerWorldBindingsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); } void V8TestObject::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute_Getter"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -10606,156 +10986,218 @@ } void V8TestObject::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute_Getter"); + TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(info); } void V8TestObject::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); } void V8TestObject::locationAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_location_Getter"); + TestObjectV8Internal::locationAttributeGetter(info); } void V8TestObject::locationAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_location_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::locationAttributeSetter(v8Value, info); } void V8TestObject::locationWithExceptionAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationWithException_Getter"); + TestObjectV8Internal::locationWithExceptionAttributeGetter(info); } void V8TestObject::locationWithExceptionAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationWithException_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::locationWithExceptionAttributeSetter(v8Value, info); } void V8TestObject::locationWithCallWithAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationWithCallWith_Getter"); + TestObjectV8Internal::locationWithCallWithAttributeGetter(info); } void V8TestObject::locationWithCallWithAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationWithCallWith_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::locationWithCallWithAttributeSetter(v8Value, info); } void V8TestObject::locationByteStringAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationByteString_Getter"); + TestObjectV8Internal::locationByteStringAttributeGetter(info); } void V8TestObject::locationByteStringAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationByteString_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::locationByteStringAttributeSetter(v8Value, info); } void V8TestObject::locationWithPerWorldBindingsAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationWithPerWorldBindings_Getter"); + TestObjectV8Internal::locationWithPerWorldBindingsAttributeGetter(info); } void V8TestObject::locationWithPerWorldBindingsAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationWithPerWorldBindings_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::locationWithPerWorldBindingsAttributeSetter(v8Value, info); } void V8TestObject::locationWithPerWorldBindingsAttributeGetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationWithPerWorldBindings_Getter"); + TestObjectV8Internal::locationWithPerWorldBindingsAttributeGetterForMainWorld(info); } void V8TestObject::locationWithPerWorldBindingsAttributeSetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationWithPerWorldBindings_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::locationWithPerWorldBindingsAttributeSetterForMainWorld(v8Value, info); } void V8TestObject::locationLegacyInterfaceTypeCheckingAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationLegacyInterfaceTypeChecking_Getter"); + TestObjectV8Internal::locationLegacyInterfaceTypeCheckingAttributeGetter(info); } void V8TestObject::locationLegacyInterfaceTypeCheckingAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationLegacyInterfaceTypeChecking_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::locationLegacyInterfaceTypeCheckingAttributeSetter(v8Value, info); } void V8TestObject::locationGarbageCollectedAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationGarbageCollected_Getter"); + TestObjectV8Internal::locationGarbageCollectedAttributeGetter(info); } void V8TestObject::locationGarbageCollectedAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationGarbageCollected_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::locationGarbageCollectedAttributeSetter(v8Value, info); } void V8TestObject::raisesExceptionLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionLongAttribute_Getter"); + TestObjectV8Internal::raisesExceptionLongAttributeAttributeGetter(info); } void V8TestObject::raisesExceptionLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::raisesExceptionLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::raisesExceptionGetterLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionGetterLongAttribute_Getter"); + TestObjectV8Internal::raisesExceptionGetterLongAttributeAttributeGetter(info); } void V8TestObject::raisesExceptionGetterLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionGetterLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::raisesExceptionGetterLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::setterRaisesExceptionLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_setterRaisesExceptionLongAttribute_Getter"); + TestObjectV8Internal::setterRaisesExceptionLongAttributeAttributeGetter(info); } void V8TestObject::setterRaisesExceptionLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_setterRaisesExceptionLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::setterRaisesExceptionLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::raisesExceptionTestInterfaceEmptyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionTestInterfaceEmptyAttribute_Getter"); + TestObjectV8Internal::raisesExceptionTestInterfaceEmptyAttributeAttributeGetter(info); } void V8TestObject::raisesExceptionTestInterfaceEmptyAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionTestInterfaceEmptyAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::raisesExceptionTestInterfaceEmptyAttributeAttributeSetter(v8Value, info); } void V8TestObject::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cachedAttributeRaisesExceptionGetterAnyAttribute_Getter"); + TestObjectV8Internal::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetter(info); } void V8TestObject::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cachedAttributeRaisesExceptionGetterAnyAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetter(v8Value, info); } void V8TestObject::reflectTestInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectTestInterfaceAttribute_Getter"); + TestObjectV8Internal::reflectTestInterfaceAttributeAttributeGetter(info); } void V8TestObject::reflectTestInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectTestInterfaceAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10764,10 +11206,14 @@ } void V8TestObject::reflectReflectedNameAttributeTestAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectReflectedNameAttributeTestAttribute_Getter"); + TestObjectV8Internal::reflectReflectedNameAttributeTestAttributeAttributeGetter(info); } void V8TestObject::reflectReflectedNameAttributeTestAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectReflectedNameAttributeTestAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10776,10 +11222,14 @@ } void V8TestObject::reflectBooleanAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectBooleanAttribute_Getter"); + TestObjectV8Internal::reflectBooleanAttributeAttributeGetter(info); } void V8TestObject::reflectBooleanAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectBooleanAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10788,10 +11238,14 @@ } void V8TestObject::reflectLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectLongAttribute_Getter"); + TestObjectV8Internal::reflectLongAttributeAttributeGetter(info); } void V8TestObject::reflectLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10800,10 +11254,14 @@ } void V8TestObject::reflectUnsignedShortAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectUnsignedShortAttribute_Getter"); + TestObjectV8Internal::reflectUnsignedShortAttributeAttributeGetter(info); } void V8TestObject::reflectUnsignedShortAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectUnsignedShortAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10812,10 +11270,14 @@ } void V8TestObject::reflectUnsignedLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectUnsignedLongAttribute_Getter"); + TestObjectV8Internal::reflectUnsignedLongAttributeAttributeGetter(info); } void V8TestObject::reflectUnsignedLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectUnsignedLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10824,10 +11286,14 @@ } void V8TestObject::idAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_id_Getter"); + TestObjectV8Internal::idAttributeGetter(info); } void V8TestObject::idAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_id_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10836,10 +11302,14 @@ } void V8TestObject::nameAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_name_Getter"); + TestObjectV8Internal::nameAttributeGetter(info); } void V8TestObject::nameAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_name_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10848,10 +11318,14 @@ } void V8TestObject::classAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_class_Getter"); + TestObjectV8Internal::classAttributeGetter(info); } void V8TestObject::classAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_class_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10860,10 +11334,14 @@ } void V8TestObject::reflectedIdAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectedId_Getter"); + TestObjectV8Internal::reflectedIdAttributeGetter(info); } void V8TestObject::reflectedIdAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectedId_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10872,10 +11350,14 @@ } void V8TestObject::reflectedNameAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectedName_Getter"); + TestObjectV8Internal::reflectedNameAttributeGetter(info); } void V8TestObject::reflectedNameAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectedName_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10884,10 +11366,14 @@ } void V8TestObject::reflectedClassAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectedClass_Getter"); + TestObjectV8Internal::reflectedClassAttributeGetter(info); } void V8TestObject::reflectedClassAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_reflectedClass_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10896,10 +11382,14 @@ } void V8TestObject::limitedToOnlyOneAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedToOnlyOneAttribute_Getter"); + TestObjectV8Internal::limitedToOnlyOneAttributeAttributeGetter(info); } void V8TestObject::limitedToOnlyOneAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedToOnlyOneAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10908,10 +11398,14 @@ } void V8TestObject::limitedToOnlyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedToOnlyAttribute_Getter"); + TestObjectV8Internal::limitedToOnlyAttributeAttributeGetter(info); } void V8TestObject::limitedToOnlyAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedToOnlyAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10920,10 +11414,14 @@ } void V8TestObject::limitedToOnlyOtherAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedToOnlyOtherAttribute_Getter"); + TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeGetter(info); } void V8TestObject::limitedToOnlyOtherAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedToOnlyOtherAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10932,10 +11430,14 @@ } void V8TestObject::limitedWithMissingDefaultAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedWithMissingDefaultAttribute_Getter"); + TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeGetter(info); } void V8TestObject::limitedWithMissingDefaultAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedWithMissingDefaultAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10944,10 +11446,14 @@ } void V8TestObject::limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedWithInvalidMissingDefaultAttribute_Getter"); + TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetter(info); } void V8TestObject::limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedWithInvalidMissingDefaultAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -10956,23 +11462,25 @@ } void V8TestObject::corsSettingAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_corsSettingAttribute_Getter"); + TestObjectV8Internal::corsSettingAttributeAttributeGetter(info); } void V8TestObject::limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedWithEmptyMissingInvalidAttribute_Getter"); + TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetter(info); } void V8TestObject::RuntimeCallStatsCounterAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { - RUNTIME_CALL_TIMER_SCOPE(info.GetIsolate(), - RuntimeCallStats::CounterId::kRuntimeCallStatsCounterAttribute_Getter); + RUNTIME_CALL_TIMER_SCOPE(info.GetIsolate(), RuntimeCallStats::CounterId::kRuntimeCallStatsCounterAttribute_Getter); TestObjectV8Internal::RuntimeCallStatsCounterAttributeAttributeGetter(info); } void V8TestObject::RuntimeCallStatsCounterAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { - RUNTIME_CALL_TIMER_SCOPE(info.GetIsolate(), - RuntimeCallStats::CounterId::kRuntimeCallStatsCounterAttribute_Setter); + RUNTIME_CALL_TIMER_SCOPE(info.GetIsolate(), RuntimeCallStats::CounterId::kRuntimeCallStatsCounterAttribute_Setter); v8::Local<v8::Value> v8Value = info[0]; @@ -10980,117 +11488,160 @@ } void V8TestObject::RuntimeCallStatsCounterReadOnlyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { - RUNTIME_CALL_TIMER_SCOPE(info.GetIsolate(), - RuntimeCallStats::CounterId::kRuntimeCallStatsCounterReadOnlyAttribute_Getter); + RUNTIME_CALL_TIMER_SCOPE(info.GetIsolate(), RuntimeCallStats::CounterId::kRuntimeCallStatsCounterReadOnlyAttribute_Getter); TestObjectV8Internal::RuntimeCallStatsCounterReadOnlyAttributeAttributeGetter(info); } void V8TestObject::replaceableReadonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_replaceableReadonlyLongAttribute_Getter"); + TestObjectV8Internal::replaceableReadonlyLongAttributeAttributeGetter(info); } void V8TestObject::replaceableReadonlyLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_replaceableReadonlyLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::replaceableReadonlyLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::locationPutForwardsAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationPutForwards_Getter"); + TestObjectV8Internal::locationPutForwardsAttributeGetter(info); } void V8TestObject::locationPutForwardsAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_locationPutForwards_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::locationPutForwardsAttributeSetter(v8Value, info); } void V8TestObject::runtimeEnabledLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_runtimeEnabledLongAttribute_Getter"); + TestObjectV8Internal::runtimeEnabledLongAttributeAttributeGetter(info); } void V8TestObject::runtimeEnabledLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_runtimeEnabledLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::runtimeEnabledLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::setterCallWithCurrentWindowAndEnteredWindowStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_setterCallWithCurrentWindowAndEnteredWindowStringAttribute_Getter"); + TestObjectV8Internal::setterCallWithCurrentWindowAndEnteredWindowStringAttributeAttributeGetter(info); } void V8TestObject::setterCallWithCurrentWindowAndEnteredWindowStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_setterCallWithCurrentWindowAndEnteredWindowStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::setterCallWithCurrentWindowAndEnteredWindowStringAttributeAttributeSetter(v8Value, info); } void V8TestObject::setterCallWithExecutionContextStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_setterCallWithExecutionContextStringAttribute_Getter"); + TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeGetter(info); } void V8TestObject::setterCallWithExecutionContextStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_setterCallWithExecutionContextStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeSetter(v8Value, info); } void V8TestObject::treatNullAsEmptyStringStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_treatNullAsEmptyStringStringAttribute_Getter"); + TestObjectV8Internal::treatNullAsEmptyStringStringAttributeAttributeGetter(info); } void V8TestObject::treatNullAsEmptyStringStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_treatNullAsEmptyStringStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::treatNullAsEmptyStringStringAttributeAttributeSetter(v8Value, info); } void V8TestObject::treatNullAsNullStringStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_treatNullAsNullStringStringAttribute_Getter"); + TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeGetter(info); } void V8TestObject::treatNullAsNullStringStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_treatNullAsNullStringStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeSetter(v8Value, info); } void V8TestObject::legacyInterfaceTypeCheckingFloatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_legacyInterfaceTypeCheckingFloatAttribute_Getter"); + TestObjectV8Internal::legacyInterfaceTypeCheckingFloatAttributeAttributeGetter(info); } void V8TestObject::legacyInterfaceTypeCheckingFloatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_legacyInterfaceTypeCheckingFloatAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::legacyInterfaceTypeCheckingFloatAttributeAttributeSetter(v8Value, info); } void V8TestObject::legacyInterfaceTypeCheckingTestInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_legacyInterfaceTypeCheckingTestInterfaceAttribute_Getter"); + TestObjectV8Internal::legacyInterfaceTypeCheckingTestInterfaceAttributeAttributeGetter(info); } void V8TestObject::legacyInterfaceTypeCheckingTestInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_legacyInterfaceTypeCheckingTestInterfaceAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::legacyInterfaceTypeCheckingTestInterfaceAttributeAttributeSetter(v8Value, info); } void V8TestObject::legacyInterfaceTypeCheckingTestInterfaceOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_legacyInterfaceTypeCheckingTestInterfaceOrNullAttribute_Getter"); + TestObjectV8Internal::legacyInterfaceTypeCheckingTestInterfaceOrNullAttributeAttributeGetter(info); } void V8TestObject::legacyInterfaceTypeCheckingTestInterfaceOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_legacyInterfaceTypeCheckingTestInterfaceOrNullAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::legacyInterfaceTypeCheckingTestInterfaceOrNullAttributeAttributeSetter(v8Value, info); } void V8TestObject::urlStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_urlStringAttribute_Getter"); + TestObjectV8Internal::urlStringAttributeAttributeGetter(info); } void V8TestObject::urlStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_urlStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -11099,10 +11650,14 @@ } void V8TestObject::urlStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_urlStringAttribute_Getter"); + TestObjectV8Internal::urlStringAttributeAttributeGetter(info); } void V8TestObject::urlStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_urlStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; @@ -11111,22 +11666,30 @@ } void V8TestObject::unforgeableLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unforgeableLongAttribute_Getter"); + TestObjectV8Internal::unforgeableLongAttributeAttributeGetter(info); } void V8TestObject::unforgeableLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unforgeableLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::unforgeableLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::measuredLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_measuredLongAttribute_Getter"); + UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kV8TestObject_MeasuredLongAttribute_AttributeGetter); TestObjectV8Internal::measuredLongAttributeAttributeGetter(info); } void V8TestObject::measuredLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_measuredLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kV8TestObject_MeasuredLongAttribute_AttributeSetter); @@ -11135,790 +11698,1178 @@ } void V8TestObject::sameObjectAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_sameObjectAttribute_Getter"); + TestObjectV8Internal::sameObjectAttributeAttributeGetter(info); } void V8TestObject::saveSameObjectAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_saveSameObjectAttribute_Getter"); + TestObjectV8Internal::saveSameObjectAttributeAttributeGetter(info); } void V8TestObject::staticSaveSameObjectAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_staticSaveSameObjectAttribute_Getter"); + TestObjectV8Internal::staticSaveSameObjectAttributeAttributeGetter(info); } void V8TestObject::unscopableLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unscopableLongAttribute_Getter"); + TestObjectV8Internal::unscopableLongAttributeAttributeGetter(info); } void V8TestObject::unscopableLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unscopableLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::unscopableLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::unscopableOriginTrialEnabledLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unscopableOriginTrialEnabledLongAttribute_Getter"); + TestObjectV8Internal::unscopableOriginTrialEnabledLongAttributeAttributeGetter(info); } void V8TestObject::unscopableOriginTrialEnabledLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unscopableOriginTrialEnabledLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::unscopableOriginTrialEnabledLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::unscopableRuntimeEnabledLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unscopableRuntimeEnabledLongAttribute_Getter"); + TestObjectV8Internal::unscopableRuntimeEnabledLongAttributeAttributeGetter(info); } void V8TestObject::unscopableRuntimeEnabledLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unscopableRuntimeEnabledLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::unscopableRuntimeEnabledLongAttributeAttributeSetter(v8Value, info); } void V8TestObject::testInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceAttribute_Getter"); + TestObjectV8Internal::testInterfaceAttributeAttributeGetter(info); } void V8TestObject::testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testInterfaceAttributeAttributeSetter(v8Value, info); } void V8TestObject::testInterfaceGarbageCollectedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceGarbageCollectedAttribute_Getter"); + TestObjectV8Internal::testInterfaceGarbageCollectedAttributeAttributeGetter(info); } void V8TestObject::testInterfaceGarbageCollectedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceGarbageCollectedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testInterfaceGarbageCollectedAttributeAttributeSetter(v8Value, info); } void V8TestObject::testInterfaceGarbageCollectedOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceGarbageCollectedOrNullAttribute_Getter"); + TestObjectV8Internal::testInterfaceGarbageCollectedOrNullAttributeAttributeGetter(info); } void V8TestObject::testInterfaceGarbageCollectedOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceGarbageCollectedOrNullAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestObjectV8Internal::testInterfaceGarbageCollectedOrNullAttributeAttributeSetter(v8Value, info); } void V8TestObject::sizeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_size_Getter"); + TestObjectV8Internal::sizeAttributeGetter(info); } void V8TestObject::unscopableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unscopableVoidMethod"); + TestObjectV8Internal::unscopableVoidMethodMethod(info); } void V8TestObject::unscopableRuntimeEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unscopableRuntimeEnabledVoidMethod"); + TestObjectV8Internal::unscopableRuntimeEnabledVoidMethodMethod(info); } void V8TestObject::voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethod"); + TestObjectV8Internal::voidMethodMethod(info); } void V8TestObject::staticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_staticVoidMethod"); + TestObjectV8Internal::staticVoidMethodMethod(info); } void V8TestObject::dateMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_dateMethod"); + TestObjectV8Internal::dateMethodMethod(info); } void V8TestObject::stringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringMethod"); + TestObjectV8Internal::stringMethodMethod(info); } void V8TestObject::byteStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_byteStringMethod"); + TestObjectV8Internal::byteStringMethodMethod(info); } void V8TestObject::usvStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_usvStringMethod"); + TestObjectV8Internal::usvStringMethodMethod(info); } void V8TestObject::readonlyDOMTimeStampMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_readonlyDOMTimeStampMethod"); + TestObjectV8Internal::readonlyDOMTimeStampMethodMethod(info); } void V8TestObject::booleanMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_booleanMethod"); + TestObjectV8Internal::booleanMethodMethod(info); } void V8TestObject::byteMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_byteMethod"); + TestObjectV8Internal::byteMethodMethod(info); } void V8TestObject::doubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_doubleMethod"); + TestObjectV8Internal::doubleMethodMethod(info); } void V8TestObject::floatMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_floatMethod"); + TestObjectV8Internal::floatMethodMethod(info); } void V8TestObject::longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longMethod"); + TestObjectV8Internal::longMethodMethod(info); } void V8TestObject::longLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longLongMethod"); + TestObjectV8Internal::longLongMethodMethod(info); } void V8TestObject::octetMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_octetMethod"); + TestObjectV8Internal::octetMethodMethod(info); } void V8TestObject::shortMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_shortMethod"); + TestObjectV8Internal::shortMethodMethod(info); } void V8TestObject::unsignedLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unsignedLongMethod"); + TestObjectV8Internal::unsignedLongMethodMethod(info); } void V8TestObject::unsignedLongLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unsignedLongLongMethod"); + TestObjectV8Internal::unsignedLongLongMethodMethod(info); } void V8TestObject::unsignedShortMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unsignedShortMethod"); + TestObjectV8Internal::unsignedShortMethodMethod(info); } void V8TestObject::voidMethodDateArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDateArg"); + TestObjectV8Internal::voidMethodDateArgMethod(info); } void V8TestObject::voidMethodStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodStringArg"); + TestObjectV8Internal::voidMethodStringArgMethod(info); } void V8TestObject::voidMethodByteStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodByteStringArg"); + TestObjectV8Internal::voidMethodByteStringArgMethod(info); } void V8TestObject::voidMethodUSVStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodUSVStringArg"); + TestObjectV8Internal::voidMethodUSVStringArgMethod(info); } void V8TestObject::voidMethodDOMTimeStampArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDOMTimeStampArg"); + TestObjectV8Internal::voidMethodDOMTimeStampArgMethod(info); } void V8TestObject::voidMethodBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodBooleanArg"); + TestObjectV8Internal::voidMethodBooleanArgMethod(info); } void V8TestObject::voidMethodByteArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodByteArg"); + TestObjectV8Internal::voidMethodByteArgMethod(info); } void V8TestObject::voidMethodDoubleArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDoubleArg"); + TestObjectV8Internal::voidMethodDoubleArgMethod(info); } void V8TestObject::voidMethodFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodFloatArg"); + TestObjectV8Internal::voidMethodFloatArgMethod(info); } void V8TestObject::voidMethodLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodLongArg"); + TestObjectV8Internal::voidMethodLongArgMethod(info); } void V8TestObject::voidMethodLongLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodLongLongArg"); + TestObjectV8Internal::voidMethodLongLongArgMethod(info); } void V8TestObject::voidMethodOctetArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodOctetArg"); + TestObjectV8Internal::voidMethodOctetArgMethod(info); } void V8TestObject::voidMethodShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodShortArg"); + TestObjectV8Internal::voidMethodShortArgMethod(info); } void V8TestObject::voidMethodUnsignedLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodUnsignedLongArg"); + TestObjectV8Internal::voidMethodUnsignedLongArgMethod(info); } void V8TestObject::voidMethodUnsignedLongLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodUnsignedLongLongArg"); + TestObjectV8Internal::voidMethodUnsignedLongLongArgMethod(info); } void V8TestObject::voidMethodUnsignedShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodUnsignedShortArg"); + TestObjectV8Internal::voidMethodUnsignedShortArgMethod(info); } void V8TestObject::testInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptyMethod"); + TestObjectV8Internal::testInterfaceEmptyMethodMethod(info); } void V8TestObject::voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestInterfaceEmptyArg"); + TestObjectV8Internal::voidMethodTestInterfaceEmptyArgMethod(info); } void V8TestObject::voidMethodLongArgTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodLongArgTestInterfaceEmptyArg"); + TestObjectV8Internal::voidMethodLongArgTestInterfaceEmptyArgMethod(info); } void V8TestObject::anyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_anyMethod"); + TestObjectV8Internal::anyMethodMethod(info); } void V8TestObject::voidMethodEventTargetArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodEventTargetArg"); + TestObjectV8Internal::voidMethodEventTargetArgMethod(info); } void V8TestObject::voidMethodAnyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodAnyArg"); + TestObjectV8Internal::voidMethodAnyArgMethod(info); } void V8TestObject::voidMethodAttrArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodAttrArg"); + TestObjectV8Internal::voidMethodAttrArgMethod(info); } void V8TestObject::voidMethodDocumentArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDocumentArg"); + TestObjectV8Internal::voidMethodDocumentArgMethod(info); } void V8TestObject::voidMethodDocumentTypeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDocumentTypeArg"); + TestObjectV8Internal::voidMethodDocumentTypeArgMethod(info); } void V8TestObject::voidMethodElementArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodElementArg"); + TestObjectV8Internal::voidMethodElementArgMethod(info); } void V8TestObject::voidMethodNodeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodNodeArg"); + TestObjectV8Internal::voidMethodNodeArgMethod(info); } void V8TestObject::arrayBufferMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_arrayBufferMethod"); + TestObjectV8Internal::arrayBufferMethodMethod(info); } void V8TestObject::arrayBufferViewMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_arrayBufferViewMethod"); + TestObjectV8Internal::arrayBufferViewMethodMethod(info); } void V8TestObject::arrayBufferViewMethodRaisesExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_arrayBufferViewMethodRaisesException"); + TestObjectV8Internal::arrayBufferViewMethodRaisesExceptionMethod(info); } void V8TestObject::float32ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_float32ArrayMethod"); + TestObjectV8Internal::float32ArrayMethodMethod(info); } void V8TestObject::int32ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_int32ArrayMethod"); + TestObjectV8Internal::int32ArrayMethodMethod(info); } void V8TestObject::uint8ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_uint8ArrayMethod"); + TestObjectV8Internal::uint8ArrayMethodMethod(info); } void V8TestObject::voidMethodArrayBufferArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodArrayBufferArg"); + TestObjectV8Internal::voidMethodArrayBufferArgMethod(info); } void V8TestObject::voidMethodArrayBufferOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodArrayBufferOrNullArg"); + TestObjectV8Internal::voidMethodArrayBufferOrNullArgMethod(info); } void V8TestObject::voidMethodArrayBufferViewArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodArrayBufferViewArg"); + TestObjectV8Internal::voidMethodArrayBufferViewArgMethod(info); } void V8TestObject::voidMethodFlexibleArrayBufferViewArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodFlexibleArrayBufferViewArg"); + TestObjectV8Internal::voidMethodFlexibleArrayBufferViewArgMethod(info); } void V8TestObject::voidMethodFlexibleArrayBufferViewTypedArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodFlexibleArrayBufferViewTypedArg"); + TestObjectV8Internal::voidMethodFlexibleArrayBufferViewTypedArgMethod(info); } void V8TestObject::voidMethodFloat32ArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodFloat32ArrayArg"); + TestObjectV8Internal::voidMethodFloat32ArrayArgMethod(info); } void V8TestObject::voidMethodInt32ArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodInt32ArrayArg"); + TestObjectV8Internal::voidMethodInt32ArrayArgMethod(info); } void V8TestObject::voidMethodUint8ArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodUint8ArrayArg"); + TestObjectV8Internal::voidMethodUint8ArrayArgMethod(info); } void V8TestObject::voidMethodAllowSharedArrayBufferViewArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodAllowSharedArrayBufferViewArg"); + TestObjectV8Internal::voidMethodAllowSharedArrayBufferViewArgMethod(info); } void V8TestObject::voidMethodAllowSharedUint8ArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodAllowSharedUint8ArrayArg"); + TestObjectV8Internal::voidMethodAllowSharedUint8ArrayArgMethod(info); } void V8TestObject::longArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longArrayMethod"); + TestObjectV8Internal::longArrayMethodMethod(info); } void V8TestObject::stringArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringArrayMethod"); + TestObjectV8Internal::stringArrayMethodMethod(info); } void V8TestObject::testInterfaceEmptyArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptyArrayMethod"); + TestObjectV8Internal::testInterfaceEmptyArrayMethodMethod(info); } void V8TestObject::voidMethodArrayLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodArrayLongArg"); + TestObjectV8Internal::voidMethodArrayLongArgMethod(info); } void V8TestObject::voidMethodArrayStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodArrayStringArg"); + TestObjectV8Internal::voidMethodArrayStringArgMethod(info); } void V8TestObject::voidMethodArrayTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodArrayTestInterfaceEmptyArg"); + TestObjectV8Internal::voidMethodArrayTestInterfaceEmptyArgMethod(info); } void V8TestObject::voidMethodNullableArrayLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodNullableArrayLongArg"); + TestObjectV8Internal::voidMethodNullableArrayLongArgMethod(info); } void V8TestObject::longSequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longSequenceMethod"); + TestObjectV8Internal::longSequenceMethodMethod(info); } void V8TestObject::stringSequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringSequenceMethod"); + TestObjectV8Internal::stringSequenceMethodMethod(info); } void V8TestObject::testInterfaceEmptySequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptySequenceMethod"); + TestObjectV8Internal::testInterfaceEmptySequenceMethodMethod(info); } void V8TestObject::voidMethodSequenceLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodSequenceLongArg"); + TestObjectV8Internal::voidMethodSequenceLongArgMethod(info); } void V8TestObject::voidMethodSequenceStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodSequenceStringArg"); + TestObjectV8Internal::voidMethodSequenceStringArgMethod(info); } void V8TestObject::voidMethodSequenceTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodSequenceTestInterfaceEmptyArg"); + TestObjectV8Internal::voidMethodSequenceTestInterfaceEmptyArgMethod(info); } void V8TestObject::voidMethodSequenceSequenceDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodSequenceSequenceDOMStringArg"); + TestObjectV8Internal::voidMethodSequenceSequenceDOMStringArgMethod(info); } void V8TestObject::voidMethodNullableSequenceLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodNullableSequenceLongArg"); + TestObjectV8Internal::voidMethodNullableSequenceLongArgMethod(info); } void V8TestObject::longFrozenArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longFrozenArrayMethod"); + TestObjectV8Internal::longFrozenArrayMethodMethod(info); } void V8TestObject::voidMethodStringFrozenArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodStringFrozenArrayMethod"); + TestObjectV8Internal::voidMethodStringFrozenArrayMethodMethod(info); } void V8TestObject::voidMethodTestInterfaceEmptyFrozenArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestInterfaceEmptyFrozenArrayMethod"); + TestObjectV8Internal::voidMethodTestInterfaceEmptyFrozenArrayMethodMethod(info); } void V8TestObject::nullableLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nullableLongMethod"); + TestObjectV8Internal::nullableLongMethodMethod(info); } void V8TestObject::nullableStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nullableStringMethod"); + TestObjectV8Internal::nullableStringMethodMethod(info); } void V8TestObject::nullableTestInterfaceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nullableTestInterfaceMethod"); + TestObjectV8Internal::nullableTestInterfaceMethodMethod(info); } void V8TestObject::nullableLongSequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nullableLongSequenceMethod"); + TestObjectV8Internal::nullableLongSequenceMethodMethod(info); } void V8TestObject::testInterfaceGarbageCollectedOrDOMStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceGarbageCollectedOrDOMStringMethod"); + TestObjectV8Internal::testInterfaceGarbageCollectedOrDOMStringMethodMethod(info); } void V8TestObject::booleanOrDOMStringOrUnrestrictedDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_booleanOrDOMStringOrUnrestrictedDoubleMethod"); + TestObjectV8Internal::booleanOrDOMStringOrUnrestrictedDoubleMethodMethod(info); } void V8TestObject::testInterfaceOrLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceOrLongMethod"); + TestObjectV8Internal::testInterfaceOrLongMethodMethod(info); } void V8TestObject::staticTestInterfaceGarbageCollectedOrDOMStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_staticTestInterfaceGarbageCollectedOrDOMStringMethod"); + TestObjectV8Internal::staticTestInterfaceGarbageCollectedOrDOMStringMethodMethod(info); } void V8TestObject::voidMethodDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDoubleOrDOMStringArg"); + TestObjectV8Internal::voidMethodDoubleOrDOMStringArgMethod(info); } void V8TestObject::voidMethodDoubleOrDOMStringOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDoubleOrDOMStringOrNullArg"); + TestObjectV8Internal::voidMethodDoubleOrDOMStringOrNullArgMethod(info); } void V8TestObject::voidMethodDoubleOrNullOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDoubleOrNullOrDOMStringArg"); + TestObjectV8Internal::voidMethodDoubleOrNullOrDOMStringArgMethod(info); } void V8TestObject::voidMethodDOMStringOrArrayBufferOrArrayBufferViewArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDOMStringOrArrayBufferOrArrayBufferViewArg"); + TestObjectV8Internal::voidMethodDOMStringOrArrayBufferOrArrayBufferViewArgMethod(info); } void V8TestObject::voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg"); + TestObjectV8Internal::voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethod(info); } void V8TestObject::voidMethodBooleanOrElementSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodBooleanOrElementSequenceArg"); + TestObjectV8Internal::voidMethodBooleanOrElementSequenceArgMethod(info); } void V8TestObject::voidMethodDoubleOrLongOrBooleanSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDoubleOrLongOrBooleanSequenceArg"); + TestObjectV8Internal::voidMethodDoubleOrLongOrBooleanSequenceArgMethod(info); } void V8TestObject::voidMethodElementSequenceOrByteStringDoubleOrStringRecordMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodElementSequenceOrByteStringDoubleOrStringRecord"); + TestObjectV8Internal::voidMethodElementSequenceOrByteStringDoubleOrStringRecordMethod(info); } void V8TestObject::voidMethodArrayOfDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodArrayOfDoubleOrDOMStringArg"); + TestObjectV8Internal::voidMethodArrayOfDoubleOrDOMStringArgMethod(info); } void V8TestObject::voidMethodTestInterfaceEmptyOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestInterfaceEmptyOrNullArg"); + TestObjectV8Internal::voidMethodTestInterfaceEmptyOrNullArgMethod(info); } void V8TestObject::voidMethodTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestCallbackInterfaceArg"); + TestObjectV8Internal::voidMethodTestCallbackInterfaceArgMethod(info); } void V8TestObject::voidMethodOptionalTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodOptionalTestCallbackInterfaceArg"); + TestObjectV8Internal::voidMethodOptionalTestCallbackInterfaceArgMethod(info); } void V8TestObject::voidMethodTestCallbackInterfaceOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestCallbackInterfaceOrNullArg"); + TestObjectV8Internal::voidMethodTestCallbackInterfaceOrNullArgMethod(info); } void V8TestObject::testEnumMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testEnumMethod"); + TestObjectV8Internal::testEnumMethodMethod(info); } void V8TestObject::voidMethodTestEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestEnumArg"); + TestObjectV8Internal::voidMethodTestEnumArgMethod(info); } void V8TestObject::voidMethodTestMultipleEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestMultipleEnumArg"); + TestObjectV8Internal::voidMethodTestMultipleEnumArgMethod(info); } void V8TestObject::dictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_dictionaryMethod"); + TestObjectV8Internal::dictionaryMethodMethod(info); } void V8TestObject::testDictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testDictionaryMethod"); + TestObjectV8Internal::testDictionaryMethodMethod(info); } void V8TestObject::nullableTestDictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nullableTestDictionaryMethod"); + TestObjectV8Internal::nullableTestDictionaryMethodMethod(info); } void V8TestObject::staticTestDictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_staticTestDictionaryMethod"); + TestObjectV8Internal::staticTestDictionaryMethodMethod(info); } void V8TestObject::staticNullableTestDictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_staticNullableTestDictionaryMethod"); + TestObjectV8Internal::staticNullableTestDictionaryMethodMethod(info); } void V8TestObject::passPermissiveDictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_passPermissiveDictionaryMethod"); + TestObjectV8Internal::passPermissiveDictionaryMethodMethod(info); } void V8TestObject::nodeFilterMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nodeFilterMethod"); + TestObjectV8Internal::nodeFilterMethodMethod(info); } void V8TestObject::promiseMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_promiseMethod"); + TestObjectV8Internal::promiseMethodMethod(info); } void V8TestObject::promiseMethodWithoutExceptionStateMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_promiseMethodWithoutExceptionState"); + TestObjectV8Internal::promiseMethodWithoutExceptionStateMethod(info); } void V8TestObject::serializedScriptValueMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_serializedScriptValueMethod"); + TestObjectV8Internal::serializedScriptValueMethodMethod(info); } void V8TestObject::xPathNSResolverMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_xPathNSResolverMethod"); + TestObjectV8Internal::xPathNSResolverMethodMethod(info); } void V8TestObject::voidMethodDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDictionaryArg"); + TestObjectV8Internal::voidMethodDictionaryArgMethod(info); } void V8TestObject::voidMethodNodeFilterArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodNodeFilterArg"); + TestObjectV8Internal::voidMethodNodeFilterArgMethod(info); } void V8TestObject::voidMethodPromiseArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodPromiseArg"); + TestObjectV8Internal::voidMethodPromiseArgMethod(info); } void V8TestObject::voidMethodSerializedScriptValueArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodSerializedScriptValueArg"); + TestObjectV8Internal::voidMethodSerializedScriptValueArgMethod(info); } void V8TestObject::voidMethodXPathNSResolverArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodXPathNSResolverArg"); + TestObjectV8Internal::voidMethodXPathNSResolverArgMethod(info); } void V8TestObject::voidMethodDictionarySequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDictionarySequenceArg"); + TestObjectV8Internal::voidMethodDictionarySequenceArgMethod(info); } void V8TestObject::voidMethodStringArgLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodStringArgLongArg"); + TestObjectV8Internal::voidMethodStringArgLongArgMethod(info); } void V8TestObject::voidMethodOptionalStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodOptionalStringArg"); + TestObjectV8Internal::voidMethodOptionalStringArgMethod(info); } void V8TestObject::voidMethodOptionalTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodOptionalTestInterfaceEmptyArg"); + TestObjectV8Internal::voidMethodOptionalTestInterfaceEmptyArgMethod(info); } void V8TestObject::voidMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodOptionalLongArg"); + TestObjectV8Internal::voidMethodOptionalLongArgMethod(info); } void V8TestObject::stringMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_stringMethodOptionalLongArg"); + TestObjectV8Internal::stringMethodOptionalLongArgMethod(info); } void V8TestObject::testInterfaceEmptyMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceEmptyMethodOptionalLongArg"); + TestObjectV8Internal::testInterfaceEmptyMethodOptionalLongArgMethod(info); } void V8TestObject::longMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_longMethodOptionalLongArg"); + TestObjectV8Internal::longMethodOptionalLongArgMethod(info); } void V8TestObject::voidMethodLongArgOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodLongArgOptionalLongArg"); + TestObjectV8Internal::voidMethodLongArgOptionalLongArgMethod(info); } void V8TestObject::voidMethodLongArgOptionalLongArgOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodLongArgOptionalLongArgOptionalLongArg"); + TestObjectV8Internal::voidMethodLongArgOptionalLongArgOptionalLongArgMethod(info); } void V8TestObject::voidMethodLongArgOptionalTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodLongArgOptionalTestInterfaceEmptyArg"); + TestObjectV8Internal::voidMethodLongArgOptionalTestInterfaceEmptyArgMethod(info); } void V8TestObject::voidMethodTestInterfaceEmptyArgOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestInterfaceEmptyArgOptionalLongArg"); + TestObjectV8Internal::voidMethodTestInterfaceEmptyArgOptionalLongArgMethod(info); } void V8TestObject::voidMethodOptionalDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodOptionalDictionaryArg"); + TestObjectV8Internal::voidMethodOptionalDictionaryArgMethod(info); } void V8TestObject::voidMethodDefaultByteStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultByteStringArg"); + TestObjectV8Internal::voidMethodDefaultByteStringArgMethod(info); } void V8TestObject::voidMethodDefaultStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultStringArg"); + TestObjectV8Internal::voidMethodDefaultStringArgMethod(info); } void V8TestObject::voidMethodDefaultIntegerArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultIntegerArgs"); + TestObjectV8Internal::voidMethodDefaultIntegerArgsMethod(info); } void V8TestObject::voidMethodDefaultDoubleArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultDoubleArg"); + TestObjectV8Internal::voidMethodDefaultDoubleArgMethod(info); } void V8TestObject::voidMethodDefaultTrueBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultTrueBooleanArg"); + TestObjectV8Internal::voidMethodDefaultTrueBooleanArgMethod(info); } void V8TestObject::voidMethodDefaultFalseBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultFalseBooleanArg"); + TestObjectV8Internal::voidMethodDefaultFalseBooleanArgMethod(info); } void V8TestObject::voidMethodDefaultNullableByteStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultNullableByteStringArg"); + TestObjectV8Internal::voidMethodDefaultNullableByteStringArgMethod(info); } void V8TestObject::voidMethodDefaultNullableStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultNullableStringArg"); + TestObjectV8Internal::voidMethodDefaultNullableStringArgMethod(info); } void V8TestObject::voidMethodDefaultNullableTestInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultNullableTestInterfaceArg"); + TestObjectV8Internal::voidMethodDefaultNullableTestInterfaceArgMethod(info); } void V8TestObject::voidMethodDefaultDoubleOrStringArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultDoubleOrStringArgs"); + TestObjectV8Internal::voidMethodDefaultDoubleOrStringArgsMethod(info); } void V8TestObject::voidMethodDefaultStringSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultStringSequenceArg"); + TestObjectV8Internal::voidMethodDefaultStringSequenceArgMethod(info); } void V8TestObject::voidMethodVariadicStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodVariadicStringArg"); + TestObjectV8Internal::voidMethodVariadicStringArgMethod(info); } void V8TestObject::voidMethodStringArgVariadicStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodStringArgVariadicStringArg"); + TestObjectV8Internal::voidMethodStringArgVariadicStringArgMethod(info); } void V8TestObject::voidMethodVariadicTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodVariadicTestInterfaceEmptyArg"); + TestObjectV8Internal::voidMethodVariadicTestInterfaceEmptyArgMethod(info); } void V8TestObject::voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg"); + TestObjectV8Internal::voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethod(info); } void V8TestObject::voidMethodVariadicTestInterfaceGarbageCollectedArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodVariadicTestInterfaceGarbageCollectedArg"); + TestObjectV8Internal::voidMethodVariadicTestInterfaceGarbageCollectedArgMethod(info); } void V8TestObject::overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodA"); + TestObjectV8Internal::overloadedMethodAMethod(info); } void V8TestObject::overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodB"); + TestObjectV8Internal::overloadedMethodBMethod(info); } void V8TestObject::overloadedMethodCMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodC"); + TestObjectV8Internal::overloadedMethodCMethod(info); } void V8TestObject::overloadedMethodDMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodD"); + TestObjectV8Internal::overloadedMethodDMethod(info); } void V8TestObject::overloadedMethodEMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodE"); + TestObjectV8Internal::overloadedMethodEMethod(info); } void V8TestObject::overloadedMethodFMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodF"); + TestObjectV8Internal::overloadedMethodFMethod(info); } void V8TestObject::overloadedMethodGMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodG"); + TestObjectV8Internal::overloadedMethodGMethod(info); } void V8TestObject::overloadedMethodHMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodH"); + TestObjectV8Internal::overloadedMethodHMethod(info); } void V8TestObject::overloadedMethodIMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodI"); + TestObjectV8Internal::overloadedMethodIMethod(info); } void V8TestObject::overloadedMethodJMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodJ"); + TestObjectV8Internal::overloadedMethodJMethod(info); } void V8TestObject::overloadedMethodKMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodK"); + TestObjectV8Internal::overloadedMethodKMethod(info); } void V8TestObject::overloadedMethodLMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodL"); + TestObjectV8Internal::overloadedMethodLMethod(info); } void V8TestObject::overloadedMethodNMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedMethodN"); + TestObjectV8Internal::overloadedMethodNMethod(info); } void V8TestObject::promiseOverloadMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_promiseOverloadMethod"); + TestObjectV8Internal::promiseOverloadMethodMethod(info); } void V8TestObject::overloadedPerWorldBindingsMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedPerWorldBindingsMethod"); + TestObjectV8Internal::overloadedPerWorldBindingsMethodMethod(info); } void V8TestObject::overloadedPerWorldBindingsMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedPerWorldBindingsMethod"); + TestObjectV8Internal::overloadedPerWorldBindingsMethodMethodForMainWorld(info); } void V8TestObject::overloadedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_overloadedStaticMethod"); + TestObjectV8Internal::overloadedStaticMethodMethod(info); } void V8TestObject::itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_item"); + TestObjectV8Internal::itemMethod(info); } void V8TestObject::setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_setItem"); + TestObjectV8Internal::setItemMethod(info); } void V8TestObject::voidMethodClampUnsignedShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodClampUnsignedShortArg"); + TestObjectV8Internal::voidMethodClampUnsignedShortArgMethod(info); } void V8TestObject::voidMethodClampUnsignedLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodClampUnsignedLongArg"); + TestObjectV8Internal::voidMethodClampUnsignedLongArgMethod(info); } void V8TestObject::voidMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultUndefinedTestInterfaceEmptyArg"); + TestObjectV8Internal::voidMethodDefaultUndefinedTestInterfaceEmptyArgMethod(info); } void V8TestObject::voidMethodDefaultUndefinedLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultUndefinedLongArg"); + TestObjectV8Internal::voidMethodDefaultUndefinedLongArgMethod(info); } void V8TestObject::voidMethodDefaultUndefinedStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDefaultUndefinedStringArg"); + TestObjectV8Internal::voidMethodDefaultUndefinedStringArgMethod(info); } void V8TestObject::voidMethodEnforceRangeLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodEnforceRangeLongArg"); + TestObjectV8Internal::voidMethodEnforceRangeLongArgMethod(info); } void V8TestObject::voidMethodTreatNullAsEmptyStringStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTreatNullAsEmptyStringStringArg"); + TestObjectV8Internal::voidMethodTreatNullAsEmptyStringStringArgMethod(info); } void V8TestObject::voidMethodTreatNullAsNullStringStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTreatNullAsNullStringStringArg"); + TestObjectV8Internal::voidMethodTreatNullAsNullStringStringArgMethod(info); } void V8TestObject::activityLoggingAccessForAllWorldsMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessForAllWorldsMethod"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -11930,145 +12881,215 @@ } void V8TestObject::callWithExecutionContextVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithExecutionContextVoidMethod"); + TestObjectV8Internal::callWithExecutionContextVoidMethodMethod(info); } void V8TestObject::callWithScriptStateVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithScriptStateVoidMethod"); + TestObjectV8Internal::callWithScriptStateVoidMethodMethod(info); } void V8TestObject::callWithScriptStateLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithScriptStateLongMethod"); + TestObjectV8Internal::callWithScriptStateLongMethodMethod(info); } void V8TestObject::callWithScriptStateExecutionContextVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithScriptStateExecutionContextVoidMethod"); + TestObjectV8Internal::callWithScriptStateExecutionContextVoidMethodMethod(info); } void V8TestObject::callWithScriptStateScriptArgumentsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithScriptStateScriptArgumentsVoidMethod"); + TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodMethod(info); } void V8TestObject::callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg"); + TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethod(info); } void V8TestObject::callWithCurrentWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithCurrentWindow"); + TestObjectV8Internal::callWithCurrentWindowMethod(info); } void V8TestObject::callWithCurrentWindowScriptWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithCurrentWindowScriptWindow"); + TestObjectV8Internal::callWithCurrentWindowScriptWindowMethod(info); } void V8TestObject::callWithThisValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithThisValue"); + TestObjectV8Internal::callWithThisValueMethod(info); } void V8TestObject::checkSecurityForNodeVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_checkSecurityForNodeVoidMethod"); + TestObjectV8Internal::checkSecurityForNodeVoidMethodMethod(info); } void V8TestObject::customVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customVoidMethod"); + V8TestObject::customVoidMethodMethodCustom(info); } void V8TestObject::customCallPrologueVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customCallPrologueVoidMethod"); + TestObjectV8Internal::customCallPrologueVoidMethodMethod(info); } void V8TestObject::customCallEpilogueVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customCallEpilogueVoidMethod"); + TestObjectV8Internal::customCallEpilogueVoidMethodMethod(info); } void V8TestObject::deprecatedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_deprecatedVoidMethod"); + Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), WebFeature::kvoidMethod); TestObjectV8Internal::deprecatedVoidMethodMethod(info); } void V8TestObject::implementedAsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_implementedAsVoidMethod"); + TestObjectV8Internal::implementedAsVoidMethodMethod(info); } void V8TestObject::measureAsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_measureAsVoidMethod"); + UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kTestFeature); TestObjectV8Internal::measureAsVoidMethodMethod(info); } void V8TestObject::measureMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_measureMethod"); + UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kV8TestObject_MeasureMethod_Method); TestObjectV8Internal::measureMethodMethod(info); } void V8TestObject::measureOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_measureOverloadedMethod"); + TestObjectV8Internal::measureOverloadedMethodMethod(info); } void V8TestObject::DeprecateAsOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_DeprecateAsOverloadedMethod"); + TestObjectV8Internal::DeprecateAsOverloadedMethodMethod(info); } void V8TestObject::DeprecateAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_DeprecateAsSameValueOverloadedMethod"); + TestObjectV8Internal::DeprecateAsSameValueOverloadedMethodMethod(info); } void V8TestObject::measureAsOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_measureAsOverloadedMethod"); + TestObjectV8Internal::measureAsOverloadedMethodMethod(info); } void V8TestObject::measureAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_measureAsSameValueOverloadedMethod"); + TestObjectV8Internal::measureAsSameValueOverloadedMethodMethod(info); } void V8TestObject::deprecateAsMeasureAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_deprecateAsMeasureAsSameValueOverloadedMethod"); + TestObjectV8Internal::deprecateAsMeasureAsSameValueOverloadedMethodMethod(info); } void V8TestObject::deprecateAsSameValueMeasureAsOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_deprecateAsSameValueMeasureAsOverloadedMethod"); + TestObjectV8Internal::deprecateAsSameValueMeasureAsOverloadedMethodMethod(info); } void V8TestObject::deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_deprecateAsSameValueMeasureAsSameValueOverloadedMethod"); + TestObjectV8Internal::deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethod(info); } void V8TestObject::notEnumerableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_notEnumerableVoidMethod"); + TestObjectV8Internal::notEnumerableVoidMethodMethod(info); } void V8TestObject::originTrialEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_originTrialEnabledVoidMethod"); + TestObjectV8Internal::originTrialEnabledVoidMethodMethod(info); } void V8TestObject::perWorldBindingsOriginTrialEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsOriginTrialEnabledVoidMethod"); + TestObjectV8Internal::perWorldBindingsOriginTrialEnabledVoidMethodMethod(info); } void V8TestObject::perWorldBindingsOriginTrialEnabledVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsOriginTrialEnabledVoidMethod"); + TestObjectV8Internal::perWorldBindingsOriginTrialEnabledVoidMethodMethodForMainWorld(info); } void V8TestObject::perWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsVoidMethod"); + TestObjectV8Internal::perWorldBindingsVoidMethodMethod(info); } void V8TestObject::perWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsVoidMethod"); + TestObjectV8Internal::perWorldBindingsVoidMethodMethodForMainWorld(info); } void V8TestObject::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsVoidMethodTestInterfaceEmptyArg"); + TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethod(info); } void V8TestObject::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsVoidMethodTestInterfaceEmptyArg"); + TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodForMainWorld(info); } void V8TestObject::postMessageMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_postMessage"); + TestObjectV8Internal::postMessageImpl("TestObject", V8TestObject::toImpl(info.Holder()), info); } void V8TestObject::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingForAllWorldsPerWorldBindingsVoidMethod"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -12080,6 +13101,8 @@ } void V8TestObject::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingForAllWorldsPerWorldBindingsVoidMethod"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -12091,6 +13114,8 @@ } void V8TestObject::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod"); + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); V8PerContextData* contextData = scriptState->PerContextData(); if (contextData && contextData->ActivityLogger()) { @@ -12102,152 +13127,224 @@ } void V8TestObject::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod"); + TestObjectV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodForMainWorld(info); } void V8TestObject::raisesExceptionVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionVoidMethod"); + TestObjectV8Internal::raisesExceptionVoidMethodMethod(info); } void V8TestObject::raisesExceptionStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionStringMethod"); + TestObjectV8Internal::raisesExceptionStringMethodMethod(info); } void V8TestObject::raisesExceptionVoidMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionVoidMethodOptionalLongArg"); + TestObjectV8Internal::raisesExceptionVoidMethodOptionalLongArgMethod(info); } void V8TestObject::raisesExceptionVoidMethodTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionVoidMethodTestCallbackInterfaceArg"); + TestObjectV8Internal::raisesExceptionVoidMethodTestCallbackInterfaceArgMethod(info); } void V8TestObject::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg"); + TestObjectV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethod(info); } void V8TestObject::raisesExceptionTestInterfaceEmptyVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionTestInterfaceEmptyVoidMethod"); + TestObjectV8Internal::raisesExceptionTestInterfaceEmptyVoidMethodMethod(info); } void V8TestObject::raisesExceptionXPathNSResolverVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionXPathNSResolverVoidMethod"); + TestObjectV8Internal::raisesExceptionXPathNSResolverVoidMethodMethod(info); } void V8TestObject::callWithExecutionContextRaisesExceptionVoidMethodLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_callWithExecutionContextRaisesExceptionVoidMethodLongArg"); + TestObjectV8Internal::callWithExecutionContextRaisesExceptionVoidMethodLongArgMethod(info); } void V8TestObject::runtimeEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_runtimeEnabledVoidMethod"); + TestObjectV8Internal::runtimeEnabledVoidMethodMethod(info); } void V8TestObject::perWorldBindingsRuntimeEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsRuntimeEnabledVoidMethod"); + TestObjectV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethod(info); } void V8TestObject::perWorldBindingsRuntimeEnabledVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsRuntimeEnabledVoidMethod"); + TestObjectV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodForMainWorld(info); } void V8TestObject::runtimeEnabledOverloadedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_runtimeEnabledOverloadedVoidMethod"); + TestObjectV8Internal::runtimeEnabledOverloadedVoidMethodMethod(info); } void V8TestObject::partiallyRuntimeEnabledOverloadedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_partiallyRuntimeEnabledOverloadedVoidMethod"); + TestObjectV8Internal::partiallyRuntimeEnabledOverloadedVoidMethodMethod(info); } void V8TestObject::legacyInterfaceTypeCheckingVoidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_legacyInterfaceTypeCheckingVoidMethodTestInterfaceEmptyArg"); + TestObjectV8Internal::legacyInterfaceTypeCheckingVoidMethodTestInterfaceEmptyArgMethod(info); } void V8TestObject::legacyInterfaceTypeCheckingVoidMethodTestInterfaceEmptyVariadicArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_legacyInterfaceTypeCheckingVoidMethodTestInterfaceEmptyVariadicArg"); + TestObjectV8Internal::legacyInterfaceTypeCheckingVoidMethodTestInterfaceEmptyVariadicArgMethod(info); } void V8TestObject::useToImpl4ArgumentsCheckingIfPossibleWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_useToImpl4ArgumentsCheckingIfPossibleWithOptionalArg"); + TestObjectV8Internal::useToImpl4ArgumentsCheckingIfPossibleWithOptionalArgMethod(info); } void V8TestObject::useToImpl4ArgumentsCheckingIfPossibleWithNullableArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_useToImpl4ArgumentsCheckingIfPossibleWithNullableArg"); + TestObjectV8Internal::useToImpl4ArgumentsCheckingIfPossibleWithNullableArgMethod(info); } void V8TestObject::useToImpl4ArgumentsCheckingIfPossibleWithUndefinedArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_useToImpl4ArgumentsCheckingIfPossibleWithUndefinedArg"); + TestObjectV8Internal::useToImpl4ArgumentsCheckingIfPossibleWithUndefinedArgMethod(info); } void V8TestObject::unforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unforgeableVoidMethod"); + TestObjectV8Internal::unforgeableVoidMethodMethod(info); } void V8TestObject::voidMethodTestInterfaceGarbageCollectedSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestInterfaceGarbageCollectedSequenceArg"); + TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedSequenceArgMethod(info); } void V8TestObject::voidMethodTestInterfaceGarbageCollectedArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodTestInterfaceGarbageCollectedArrayArg"); + TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedArrayArgMethod(info); } void V8TestObject::newObjectTestInterfaceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_newObjectTestInterfaceMethod"); + TestObjectV8Internal::newObjectTestInterfaceMethodMethod(info); } void V8TestObject::RuntimeCallStatsCounterMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { - RUNTIME_CALL_TIMER_SCOPE(info.GetIsolate(), - RuntimeCallStats::CounterId::kRuntimeCallStatsCounterMethod); + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "kRuntimeCallStatsCounterMethod"); + TestObjectV8Internal::RuntimeCallStatsCounterMethodMethod(info); } void V8TestObject::serializerMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_serializerMethod"); + TestObjectV8Internal::serializerMethodMethod(info); } void V8TestObject::clearMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_clear"); + TestObjectV8Internal::clearMethod(info); } void V8TestObject::keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_keys"); + TestObjectV8Internal::keysMethod(info); } void V8TestObject::valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_values"); + TestObjectV8Internal::valuesMethod(info); } void V8TestObject::forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_forEach"); + TestObjectV8Internal::forEachMethod(info); } void V8TestObject::hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_has"); + TestObjectV8Internal::hasMethod(info); } void V8TestObject::getMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_get"); + TestObjectV8Internal::getMethod(info); } void V8TestObject::deleteMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_delete"); + TestObjectV8Internal::deleteMethod(info); } void V8TestObject::setMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_set"); + TestObjectV8Internal::setMethod(info); } void V8TestObject::toJSONMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_toJSON"); + TestObjectV8Internal::toJSONMethod(info); } void V8TestObject::toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_toString"); + TestObjectV8Internal::toStringMethod(info); } void V8TestObject::iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_iterator"); + TestObjectV8Internal::iteratorMethod(info); } void V8TestObject::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_NamedPropertyGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -12256,6 +13353,8 @@ } void V8TestObject::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_NamedPropertySetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -12272,6 +13371,8 @@ } void V8TestObject::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_NamedPropertyQuery"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -12284,6 +13385,8 @@ } void V8TestObject::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_IndexedPropertyGetter"); + TestObjectV8Internal::indexedPropertyGetter(index, info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp index 3d045d4..cffd982 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
@@ -22,6 +22,7 @@ #include "core/dom/NodeList.h" #include "core/dom/StaticNodeList.h" #include "core/html/LabelsNodeList.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -142,10 +143,14 @@ } // namespace TestSpecialOperationsV8Internal void V8TestSpecialOperations::namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSpecialOperations_namedItem"); + TestSpecialOperationsV8Internal::namedItemMethod(info); } void V8TestSpecialOperations::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSpecialOperations_NamedPropertyGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -154,6 +159,8 @@ } void V8TestSpecialOperations::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSpecialOperations_NamedPropertySetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -162,6 +169,8 @@ } void V8TestSpecialOperations::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSpecialOperations_NamedPropertyQuery"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -174,6 +183,8 @@ } void V8TestSpecialOperations::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSpecialOperations_IndexedPropertyGetter"); + const AtomicString& propertyName = AtomicString::Number(index); TestSpecialOperationsV8Internal::namedPropertyGetter(propertyName, info);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp index 6cdc9a8..489e476 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp
@@ -113,6 +113,8 @@ } // namespace TestSpecialOperationsNotEnumerableV8Internal void V8TestSpecialOperationsNotEnumerable::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSpecialOperationsNotEnumerable_NamedPropertyGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -121,6 +123,8 @@ } void V8TestSpecialOperationsNotEnumerable::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSpecialOperationsNotEnumerable_IndexedPropertyGetter"); + TestSpecialOperationsNotEnumerableV8Internal::indexedPropertyGetter(index, info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp index ba2ebea..6520da8 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
@@ -29,6 +29,7 @@ #include "core/dom/StaticNodeList.h" #include "core/frame/LocalDOMWindow.h" #include "core/html/LabelsNodeList.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -368,6 +369,8 @@ } static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_ConstructorCallback"); + if (UNLIKELY(info.Length() < 1)) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToConstruct("TestTypedefs", ExceptionMessages::NotEnoughArguments(1, info.Length()))); return; @@ -387,78 +390,114 @@ } // namespace TestTypedefsV8Internal void V8TestTypedefs::uLongLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_uLongLongAttribute_Getter"); + TestTypedefsV8Internal::uLongLongAttributeAttributeGetter(info); } void V8TestTypedefs::uLongLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_uLongLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestTypedefsV8Internal::uLongLongAttributeAttributeSetter(v8Value, info); } void V8TestTypedefs::domStringOrDoubleOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_domStringOrDoubleOrNullAttribute_Getter"); + TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeGetter(info); } void V8TestTypedefs::domStringOrDoubleOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_domStringOrDoubleOrNullAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeSetter(v8Value, info); } void V8TestTypedefs::voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_voidMethodArrayOfLongsArg"); + TestTypedefsV8Internal::voidMethodArrayOfLongsArgMethod(info); } void V8TestTypedefs::voidMethodFloatArgStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_voidMethodFloatArgStringArg"); + TestTypedefsV8Internal::voidMethodFloatArgStringArgMethod(info); } void V8TestTypedefs::voidMethodTestCallbackInterfaceTypeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_voidMethodTestCallbackInterfaceTypeArg"); + TestTypedefsV8Internal::voidMethodTestCallbackInterfaceTypeArgMethod(info); } void V8TestTypedefs::uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_uLongLongMethodTestInterfaceEmptyTypeSequenceArg"); + TestTypedefsV8Internal::uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethod(info); } void V8TestTypedefs::testInterfaceOrTestInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_testInterfaceOrTestInterfaceEmptyMethod"); + TestTypedefsV8Internal::testInterfaceOrTestInterfaceEmptyMethodMethod(info); } void V8TestTypedefs::domStringOrDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_domStringOrDoubleMethod"); + TestTypedefsV8Internal::domStringOrDoubleMethodMethod(info); } void V8TestTypedefs::arrayOfStringsMethodArrayOfStringsArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_arrayOfStringsMethodArrayOfStringsArg"); + TestTypedefsV8Internal::arrayOfStringsMethodArrayOfStringsArgMethod(info); } void V8TestTypedefs::stringArrayMethodStringArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_stringArrayMethodStringArrayArg"); + TestTypedefsV8Internal::stringArrayMethodStringArrayArgMethod(info); } void V8TestTypedefs::methodTakingRecordMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_methodTakingRecord"); + TestTypedefsV8Internal::methodTakingRecordMethod(info); } void V8TestTypedefs::methodTakingOilpanValueRecordMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_methodTakingOilpanValueRecord"); + TestTypedefsV8Internal::methodTakingOilpanValueRecordMethod(info); } void V8TestTypedefs::unionWithRecordMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_unionWithRecordMethod"); + TestTypedefsV8Internal::unionWithRecordMethodMethod(info); } void V8TestTypedefs::methodThatReturnsRecordMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_methodThatReturnsRecord"); + TestTypedefsV8Internal::methodThatReturnsRecordMethod(info); } void V8TestTypedefs::voidMethodNestedUnionTypeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_voidMethodNestedUnionType"); + TestTypedefsV8Internal::voidMethodNestedUnionTypeMethod(info); } void V8TestTypedefs::voidMethodUnionWithTypedefMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_voidMethodUnionWithTypedef"); + TestTypedefsV8Internal::voidMethodUnionWithTypedefMethod(info); } @@ -499,6 +538,8 @@ }; void V8TestTypedefs::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestTypedefs_Constructor"); + if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("TestTypedefs")); return;
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface2Partial.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface2Partial.cpp index 7535222d..4e788843 100644 --- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface2Partial.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface2Partial.cpp
@@ -20,6 +20,7 @@ #include "bindings/tests/idls/modules/TestInterface2Partial2.h" #include "core/dom/ExecutionContext.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -63,10 +64,14 @@ } // namespace TestInterface2PartialV8Internal void V8TestInterface2Partial::voidMethodPartial1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_voidMethodPartial1"); + TestInterface2PartialV8Internal::voidMethodPartial1Method(info); } void V8TestInterface2Partial::voidMethodPartial2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface2_voidMethodPartial2"); + TestInterface2PartialV8Internal::voidMethodPartial2Method(info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp index 8c81e41..669b97d2 100644 --- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
@@ -20,6 +20,7 @@ #include "bindings/modules/v8/VoidCallbackFunctionModules.h" #include "core/dom/ExecutionContext.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -605,168 +606,242 @@ } // namespace TestInterface5ImplementationV8Internal void V8TestInterface5::testInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_testInterfaceAttribute_Getter"); + TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGetter(info); } void V8TestInterface5::testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_testInterfaceAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSetter(v8Value, info); } void V8TestInterface5::doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_doubleAttribute_Getter"); + TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info); } void V8TestInterface5::doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_doubleAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Value, info); } void V8TestInterface5::floatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_floatAttribute_Getter"); + TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info); } void V8TestInterface5::floatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_floatAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Value, info); } void V8TestInterface5::unrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_unrestrictedDoubleAttribute_Getter"); + TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeGetter(info); } void V8TestInterface5::unrestrictedDoubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_unrestrictedDoubleAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeSetter(v8Value, info); } void V8TestInterface5::unrestrictedFloatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_unrestrictedFloatAttribute_Getter"); + TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeGetter(info); } void V8TestInterface5::unrestrictedFloatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_unrestrictedFloatAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeSetter(v8Value, info); } void V8TestInterface5::staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_staticStringAttribute_Getter"); + TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter(info); } void V8TestInterface5::staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_staticStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter(v8Value, info); } void V8TestInterface5::lengthAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_length_Getter"); + TestInterface5ImplementationV8Internal::lengthAttributeGetter(info); } void V8TestInterface5::alwaysExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_alwaysExposedAttribute_Getter"); + TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetter(info); } void V8TestInterface5::alwaysExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_alwaysExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterface5::workerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_workerExposedAttribute_Getter"); + TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGetter(info); } void V8TestInterface5::workerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_workerExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterface5::windowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_windowExposedAttribute_Getter"); + TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGetter(info); } void V8TestInterface5::windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_windowExposedAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSetter(v8Value, info); } void V8TestInterface5::voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_voidMethodTestInterfaceEmptyArg"); + TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod(info); } void V8TestInterface5::voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_voidMethodDoubleArgFloatArg"); + TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(info); } void V8TestInterface5::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg"); + TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(info); } void V8TestInterface5::voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_voidMethod"); + TestInterface5ImplementationV8Internal::voidMethodMethod(info); } void V8TestInterface5::voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_voidMethod"); + TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info); } void V8TestInterface5::alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_alwaysExposedMethod"); + TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info); } void V8TestInterface5::workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_workerExposedMethod"); + TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info); } void V8TestInterface5::windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_windowExposedMethod"); + TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info); } void V8TestInterface5::alwaysExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_alwaysExposedStaticMethod"); + TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethod(info); } void V8TestInterface5::workerExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_workerExposedStaticMethod"); + TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethod(info); } void V8TestInterface5::windowExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_windowExposedStaticMethod"); + TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info); } void V8TestInterface5::windowAndServiceWorkerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_windowAndServiceWorkerExposedMethod"); + TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethod(info); } void V8TestInterface5::voidMethodBooleanOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_voidMethodBooleanOrDOMStringArg"); + TestInterface5ImplementationV8Internal::voidMethodBooleanOrDOMStringArgMethod(info); } void V8TestInterface5::voidMethodDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_voidMethodDoubleOrDOMStringArg"); + TestInterface5ImplementationV8Internal::voidMethodDoubleOrDOMStringArgMethod(info); } void V8TestInterface5::voidMethodVoidExperimentalCallbackFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_voidMethodVoidExperimentalCallbackFunction"); + TestInterface5ImplementationV8Internal::voidMethodVoidExperimentalCallbackFunctionMethod(info); } void V8TestInterface5::voidMethodVoidCallbackFunctionModulesArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_voidMethodVoidCallbackFunctionModulesArg"); + TestInterface5ImplementationV8Internal::voidMethodVoidCallbackFunctionModulesArgMethod(info); } void V8TestInterface5::toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_toString"); + TestInterface5ImplementationV8Internal::toStringMethod(info); } void V8TestInterface5::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_NamedPropertyGetter"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -775,6 +850,8 @@ } void V8TestInterface5::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_NamedPropertyQuery"); + if (!name->IsString()) return; const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); @@ -787,6 +864,8 @@ } void V8TestInterface5::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterface5Implementation_IndexedPropertyGetter"); + TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp index 0d32c442..393c7c3 100644 --- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
@@ -25,6 +25,7 @@ #include "core/dom/ExecutionContext.h" #include "core/origin_trials/OriginTrials.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/ScriptState.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" @@ -379,46 +380,66 @@ } // namespace TestInterfaceImplementationPartialV8Internal void V8TestInterfacePartial::partial4LongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial4LongAttribute_Getter"); + TestInterfaceImplementationPartialV8Internal::partial4LongAttributeAttributeGetter(info); } void V8TestInterfacePartial::partial4LongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial4LongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationPartialV8Internal::partial4LongAttributeAttributeSetter(v8Value, info); } void V8TestInterfacePartial::partial4StaticLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial4StaticLongAttribute_Getter"); + TestInterfaceImplementationPartialV8Internal::partial4StaticLongAttributeAttributeGetter(info); } void V8TestInterfacePartial::partial4StaticLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial4StaticLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestInterfaceImplementationPartialV8Internal::partial4StaticLongAttributeAttributeSetter(v8Value, info); } void V8TestInterfacePartial::partialVoidTestEnumModulesArgMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partialVoidTestEnumModulesArgMethod"); + TestInterfaceImplementationPartialV8Internal::partialVoidTestEnumModulesArgMethodMethod(info); } void V8TestInterfacePartial::partial2VoidTestEnumModulesRecordMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial2VoidTestEnumModulesRecordMethod"); + TestInterfaceImplementationPartialV8Internal::partial2VoidTestEnumModulesRecordMethodMethod(info); } void V8TestInterfacePartial::unscopableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_unscopableVoidMethod"); + TestInterfaceImplementationPartialV8Internal::unscopableVoidMethodMethod(info); } void V8TestInterfacePartial::unionWithTypedefMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_unionWithTypedefMethod"); + TestInterfaceImplementationPartialV8Internal::unionWithTypedefMethodMethod(info); } void V8TestInterfacePartial::partial4VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial4VoidMethod"); + TestInterfaceImplementationPartialV8Internal::partial4VoidMethodMethod(info); } void V8TestInterfacePartial::partial4StaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceImplementation_partial4StaticVoidMethod"); + TestInterfaceImplementationPartialV8Internal::partial4StaticVoidMethodMethod(info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.cpp index 4922d20..e85750f 100644 --- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.cpp
@@ -16,6 +16,7 @@ #include "bindings/core/v8/NativeValueTraitsImpl.h" #include "bindings/core/v8/V8DOMConfiguration.h" #include "core/dom/ExecutionContext.h" +#include "platform/bindings/RuntimeCallStats.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -120,20 +121,28 @@ } // namespace TestSubObjectV8Internal void V8TestSubObject::unforgeableStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSubObject_unforgeableStringAttribute_Getter"); + TestSubObjectV8Internal::unforgeableStringAttributeAttributeGetter(info); } void V8TestSubObject::unforgeableStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSubObject_unforgeableStringAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestSubObjectV8Internal::unforgeableStringAttributeAttributeSetter(v8Value, info); } void V8TestSubObject::unforgeableLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSubObject_unforgeableLongAttribute_Getter"); + TestSubObjectV8Internal::unforgeableLongAttributeAttributeGetter(info); } void V8TestSubObject::unforgeableLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestSubObject_unforgeableLongAttribute_Setter"); + v8::Local<v8::Value> v8Value = info[0]; TestSubObjectV8Internal::unforgeableLongAttributeAttributeSetter(v8Value, info);
diff --git a/third_party/WebKit/Source/core/dom/FirstLetterPseudoElement.cpp b/third_party/WebKit/Source/core/dom/FirstLetterPseudoElement.cpp index fda004a5..05545bad 100644 --- a/third_party/WebKit/Source/core/dom/FirstLetterPseudoElement.cpp +++ b/third_party/WebKit/Source/core/dom/FirstLetterPseudoElement.cpp
@@ -353,7 +353,13 @@ ComputedStyle* pseudo_style = StyleForFirstLetter(remaining_text_layout_object_->Parent()); DCHECK(pseudo_style); - layout_object->SetStyle(pseudo_style); + // TODO(kojii): While setting to GetLayoutObject() looks correct all the time, + // as we do so in AttachFirstLetterTextLayoutObjects(), it is required only + // when inline box has text children, and can break layout tree when changing + // :first-letter to floats. The check in Element::UpdatePseudoElement() does + // not catch all such cases. + if (!pseudo_style->IsDisplayBlockContainer()) + layout_object->SetStyle(pseudo_style); // The layoutObjects inside pseudo elements are anonymous so they don't get // notified of recalcStyle and must have
diff --git a/third_party/WebKit/Source/core/dom/Range.cpp b/third_party/WebKit/Source/core/dom/Range.cpp index 981602e..eafd671 100644 --- a/third_party/WebKit/Source/core/dom/Range.cpp +++ b/third_party/WebKit/Source/core/dom/Range.cpp
@@ -1633,17 +1633,16 @@ for (Node* node = FirstNode(); node != stop_node; node = NodeTraversal::Next(*node)) { if (node->IsElementNode()) { - // TODO(xiaochengh): Apply early continue style to reduce indentation. - if (selected_elements.Contains(node) && - !selected_elements.Contains(node->parentNode())) { - if (LayoutObject* layout_object = ToElement(node)->GetLayoutObject()) { - Vector<FloatQuad> element_quads; - layout_object->AbsoluteQuads(element_quads); - owner_document_->AdjustFloatQuadsForScrollAndAbsoluteZoom( - element_quads, *layout_object); + if (!selected_elements.Contains(node) || + selected_elements.Contains(node->parentNode())) + continue; + if (LayoutObject* layout_object = ToElement(node)->GetLayoutObject()) { + Vector<FloatQuad> element_quads; + layout_object->AbsoluteQuads(element_quads); + owner_document_->AdjustFloatQuadsForScrollAndAbsoluteZoom( + element_quads, *layout_object); - quads.AppendVector(element_quads); - } + quads.AppendVector(element_quads); } } else if (node->IsTextNode()) { if (LayoutText* layout_text = ToText(node)->GetLayoutObject()) {
diff --git a/third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp b/third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp index 4137c58..4e0f3a2 100644 --- a/third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp +++ b/third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp
@@ -4,6 +4,8 @@ #include "core/dom/UserGestureIndicator.h" +#include "core/frame/LocalFrame.h" +#include "core/frame/LocalFrameClient.h" #include "platform/Histogram.h" #include "platform/wtf/Assertions.h" #include "platform/wtf/CurrentTime.h" @@ -11,19 +13,6 @@ namespace blink { -namespace { - -void SetHasReceivedUserGesture(Document* document) { - if (document && document->GetFrame()) { - bool had_gesture = document->GetFrame()->HasReceivedUserGesture(); - if (!had_gesture) - document->GetFrame()->SetDocumentHasReceivedUserGesture(); - document->GetFrame()->Client()->SetHasReceivedUserGesture(had_gesture); - } -} - -} // namespace - // User gestures timeout in 1 second. const double kUserGestureTimeout = 1.0; @@ -33,7 +22,8 @@ // static RefPtr<UserGestureToken> UserGestureToken::Create(Document* document, Status status) { - SetHasReceivedUserGesture(document); + if (document && document->GetFrame()) + document->GetFrame()->NotifyUserActivation(); return AdoptRef(new UserGestureToken(status)); } @@ -42,7 +32,8 @@ UserGestureToken* token) { if (!token || !token->HasGestures()) return nullptr; - SetHasReceivedUserGesture(document); + if (document && document->GetFrame()) + document->GetFrame()->NotifyUserActivation(); return token; } @@ -113,20 +104,28 @@ UserGestureToken* UserGestureIndicator::root_token_ = nullptr; -UserGestureIndicator::UserGestureIndicator(PassRefPtr<UserGestureToken> token) { - // Silently ignore UserGestureIndicators on non-main threads and tokens that - // are already active. - if (!IsMainThread() || !token || token == root_token_) - return; - - token_ = std::move(token); +void UserGestureIndicator::UpdateRootToken() { if (!root_token_) { root_token_ = token_.Get(); } else { RecordUserGestureMerge(*root_token_, *token_); token_->TransferGestureTo(root_token_); } +} + +UserGestureIndicator::UserGestureIndicator(PassRefPtr<UserGestureToken> token) { + if (!IsMainThread() || !token || token == root_token_) + return; + token_ = std::move(token); token_->ResetTimestamp(); + UpdateRootToken(); +} + +UserGestureIndicator::UserGestureIndicator(UserGestureToken::Status status) { + if (!IsMainThread()) + return; + token_ = AdoptRef(new UserGestureToken(status)); + UpdateRootToken(); } UserGestureIndicator::~UserGestureIndicator() {
diff --git a/third_party/WebKit/Source/core/dom/UserGestureIndicator.h b/third_party/WebKit/Source/core/dom/UserGestureIndicator.h index 96c290a3..2749b26 100644 --- a/third_party/WebKit/Source/core/dom/UserGestureIndicator.h +++ b/third_party/WebKit/Source/core/dom/UserGestureIndicator.h
@@ -7,8 +7,6 @@ #include "core/CoreExport.h" #include "core/dom/Document.h" -#include "core/frame/LocalFrame.h" -#include "core/frame/LocalFrameClient.h" #include "platform/wtf/Noncopyable.h" #include "platform/wtf/RefCounted.h" #include "platform/wtf/RefPtr.h" @@ -26,12 +24,18 @@ enum Status { kNewGesture, kPossiblyExistingGesture }; enum TimeoutPolicy { kDefault, kOutOfProcess, kHasPaused }; + // Deprecated, use UserGestureIndicator(Status) instead. + // TODO(mustaq): Replace remaining refs and nuke this method. + // // Creates a UserGestureToken with the given status. Also if a non-null // Document* is provided, associates the token with the document. static RefPtr<UserGestureToken> Create(Document*, Status = kPossiblyExistingGesture); + static RefPtr<UserGestureToken> Adopt(Document*, UserGestureToken*); + UserGestureToken(Status); + ~UserGestureToken() {} bool HasGestures() const; void TransferGestureTo(UserGestureToken*); @@ -39,9 +43,6 @@ void SetTimeoutPolicy(TimeoutPolicy); void ResetTimestamp(); - protected: - UserGestureToken(Status); - private: bool HasTimedOut() const; @@ -74,9 +75,16 @@ static UserGestureToken* CurrentTokenThreadSafe(); explicit UserGestureIndicator(PassRefPtr<UserGestureToken>); + + // Constructs a UserGestureIndicator with a new UserGestureToken of the given + // status. + explicit UserGestureIndicator( + UserGestureToken::Status = UserGestureToken::kPossiblyExistingGesture); ~UserGestureIndicator(); private: + void UpdateRootToken(); + static UserGestureToken* root_token_; RefPtr<UserGestureToken> token_;
diff --git a/third_party/WebKit/Source/core/dom/UserGestureIndicatorTest.cpp b/third_party/WebKit/Source/core/dom/UserGestureIndicatorTest.cpp index 19ee191..c03c4d1 100644 --- a/third_party/WebKit/Source/core/dom/UserGestureIndicatorTest.cpp +++ b/third_party/WebKit/Source/core/dom/UserGestureIndicatorTest.cpp
@@ -4,6 +4,7 @@ #include "core/dom/UserGestureIndicator.h" +#include "core/frame/LocalFrame.h" #include "platform/wtf/CurrentTime.h" #include "testing/gtest/include/gtest/gtest.h" @@ -27,8 +28,8 @@ } TEST(UserGestureIndicatorTest, ConstructedWithNewUserGesture) { - UserGestureIndicator user_gesture_scope( - UserGestureToken::Create(nullptr, UserGestureToken::kNewGesture)); + std::unique_ptr<UserGestureIndicator> user_gesture_scope = + LocalFrame::CreateUserGesture(nullptr, UserGestureToken::kNewGesture); EXPECT_TRUE(UserGestureIndicator::ProcessingUserGesture()); EXPECT_NE(nullptr, UserGestureIndicator::CurrentToken()); @@ -37,7 +38,8 @@ } TEST(UserGestureIndicatorTest, ConstructedWithUserGesture) { - UserGestureIndicator user_gesture_scope(UserGestureToken::Create(nullptr)); + std::unique_ptr<UserGestureIndicator> user_gesture_scope = + LocalFrame::CreateUserGesture(nullptr); EXPECT_TRUE(UserGestureIndicator::ProcessingUserGesture()); EXPECT_NE(nullptr, UserGestureIndicator::CurrentToken()); @@ -57,7 +59,8 @@ // Check that after UserGestureIndicator destruction state will be cleared. TEST(UserGestureIndicatorTest, DestructUserGestureIndicator) { { - UserGestureIndicator user_gesture_scope(UserGestureToken::Create(nullptr)); + std::unique_ptr<UserGestureIndicator> user_gesture_scope = + LocalFrame::CreateUserGesture(nullptr); EXPECT_TRUE(UserGestureIndicator::ProcessingUserGesture()); EXPECT_NE(nullptr, UserGestureIndicator::CurrentToken()); @@ -71,16 +74,16 @@ // Tests creation of scoped UserGestureIndicator objects. TEST(UserGestureIndicatorTest, ScopedNewUserGestureIndicators) { // Root GestureIndicator and GestureToken. - UserGestureIndicator user_gesture_scope( - UserGestureToken::Create(nullptr, UserGestureToken::kNewGesture)); + std::unique_ptr<UserGestureIndicator> user_gesture_scope = + LocalFrame::CreateUserGesture(nullptr, UserGestureToken::kNewGesture); EXPECT_TRUE(UserGestureIndicator::ProcessingUserGesture()); EXPECT_NE(nullptr, UserGestureIndicator::CurrentToken()); { // Construct inner UserGestureIndicator. // It should share GestureToken with the root indicator. - UserGestureIndicator inner_user_gesture( - UserGestureToken::Create(nullptr, UserGestureToken::kNewGesture)); + std::unique_ptr<UserGestureIndicator> inner_user_gesture = + LocalFrame::CreateUserGesture(nullptr, UserGestureToken::kNewGesture); EXPECT_TRUE(UserGestureIndicator::ProcessingUserGesture()); EXPECT_NE(nullptr, UserGestureIndicator::CurrentToken()); @@ -99,8 +102,8 @@ } TEST(UserGestureIndicatorTest, MultipleGesturesWithTheSameToken) { - UserGestureIndicator indicator( - UserGestureToken::Create(nullptr, UserGestureToken::kNewGesture)); + std::unique_ptr<UserGestureIndicator> indicator = + LocalFrame::CreateUserGesture(nullptr, UserGestureToken::kNewGesture); EXPECT_TRUE(UserGestureIndicator::ProcessingUserGesture()); EXPECT_NE(nullptr, UserGestureIndicator::CurrentToken()); {
diff --git a/third_party/WebKit/Source/core/exported/WebFrame.cpp b/third_party/WebKit/Source/core/exported/WebFrame.cpp index 494a213..bf2200d 100644 --- a/third_party/WebKit/Source/core/exported/WebFrame.cpp +++ b/third_party/WebKit/Source/core/exported/WebFrame.cpp
@@ -121,7 +121,7 @@ } if (parent_ && old_frame->HasReceivedUserGesture()) - ToCoreFrame(*frame)->SetDocumentHasReceivedUserGesture(); + ToCoreFrame(*frame)->UpdateUserActivationInFrameTree(); ToCoreFrame(*frame)->GetWindowProxyManager()->SetGlobalProxies( global_proxies);
diff --git a/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp index 5153e3c..941f21d 100644 --- a/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp
@@ -340,7 +340,7 @@ } void WebRemoteFrameImpl::SetHasReceivedUserGesture() { - GetFrame()->SetDocumentHasReceivedUserGesture(); + GetFrame()->UpdateUserActivationInFrameTree(); } v8::Local<v8::Object> WebRemoteFrameImpl::GlobalProxy() const {
diff --git a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp index 8017c62..6b785b7 100644 --- a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
@@ -2213,9 +2213,8 @@ break; case WebInputEvent::kMouseDown: event_type = EventTypeNames::mousedown; - gesture_indicator = - WTF::WrapUnique(new UserGestureIndicator(UserGestureToken::Create( - &node->GetDocument(), UserGestureToken::kNewGesture))); + gesture_indicator = LocalFrame::CreateUserGesture( + node->GetDocument().GetFrame(), UserGestureToken::kNewGesture); mouse_capture_gesture_token_ = gesture_indicator->CurrentToken(); break; case WebInputEvent::kMouseUp:
diff --git a/third_party/WebKit/Source/core/exported/WorkerShadowPage.cpp b/third_party/WebKit/Source/core/exported/WorkerShadowPage.cpp index 95dfe0d..1568c160 100644 --- a/third_party/WebKit/Source/core/exported/WorkerShadowPage.cpp +++ b/third_party/WebKit/Source/core/exported/WorkerShadowPage.cpp
@@ -6,6 +6,8 @@ #include "core/exported/WebViewImpl.h" #include "core/frame/csp/ContentSecurityPolicy.h" +#include "core/loader/FrameLoadRequest.h" +#include "platform/loader/fetch/SubstituteData.h" #include "public/platform/Platform.h" #include "public/web/WebSettings.h"
diff --git a/third_party/WebKit/Source/core/frame/Frame.cpp b/third_party/WebKit/Source/core/frame/Frame.cpp index 53ac4dd..9e59f516 100644 --- a/third_party/WebKit/Source/core/frame/Frame.cpp +++ b/third_party/WebKit/Source/core/frame/Frame.cpp
@@ -180,10 +180,10 @@ child_frames[i]->DidChangeVisibilityState(); } -void Frame::SetDocumentHasReceivedUserGesture() { +void Frame::UpdateUserActivationInFrameTree() { has_received_user_gesture_ = true; if (Frame* parent = Tree().Parent()) - parent->SetDocumentHasReceivedUserGesture(); + parent->UpdateUserActivationInFrameTree(); } bool Frame::IsFeatureEnabled(WebFeaturePolicyFeature feature) const {
diff --git a/third_party/WebKit/Source/core/frame/Frame.h b/third_party/WebKit/Source/core/frame/Frame.h index 012541c1..70aab28 100644 --- a/third_party/WebKit/Source/core/frame/Frame.h +++ b/third_party/WebKit/Source/core/frame/Frame.h
@@ -143,7 +143,8 @@ virtual void DidChangeVisibilityState(); - void SetDocumentHasReceivedUserGesture(); + void UpdateUserActivationInFrameTree(); + bool HasReceivedUserGesture() const { return has_received_user_gesture_; } void ClearDocumentHasReceivedUserGesture() { has_received_user_gesture_ = false;
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp index c98f0297..f260ad81 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -123,6 +123,7 @@ template class CORE_TEMPLATE_EXPORT Supplement<LocalFrame>; +// static LocalFrame* LocalFrame::Create(LocalFrameClient* client, Page& page, FrameOwner* owner, @@ -1106,4 +1107,20 @@ } } +void LocalFrame::NotifyUserActivation() { + bool had_gesture = HasReceivedUserGesture(); + if (!had_gesture) + UpdateUserActivationInFrameTree(); + Client()->SetHasReceivedUserGesture(had_gesture); +} + +// static +std::unique_ptr<UserGestureIndicator> LocalFrame::CreateUserGesture( + LocalFrame* frame, + UserGestureToken::Status status) { + if (frame) + frame->NotifyUserActivation(); + return WTF::MakeUnique<UserGestureIndicator>(status); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.h b/third_party/WebKit/Source/core/frame/LocalFrame.h index 8d999cc..d687ab0 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.h +++ b/third_party/WebKit/Source/core/frame/LocalFrame.h
@@ -31,6 +31,7 @@ #include <memory> #include "core/CoreExport.h" +#include "core/dom/UserGestureIndicator.h" #include "core/dom/WeakIdentifierMap.h" #include "core/frame/Frame.h" #include "core/frame/LocalFrameView.h" @@ -269,6 +270,15 @@ void SetViewportIntersectionFromParent(const IntRect&); IntRect RemoteViewportIntersection() { return remote_viewport_intersection_; } + void NotifyUserActivation(); + + // Creates a UserGestureIndicator that contains a UserGestureToken with the + // given status. Also if a non-null LocalFrame* is provided, associates the + // token with the frame tree. + static std::unique_ptr<UserGestureIndicator> CreateUserGesture( + LocalFrame*, + UserGestureToken::Status = UserGestureToken::kPossiblyExistingGesture); + private: friend class FrameNavigationDisabler;
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp index 5271b65..55a1532 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
@@ -3243,10 +3243,10 @@ void LocalFrameView::PerformScrollAnchoringAdjustments() { for (WeakMember<ScrollableArea>& scroller : anchoring_adjustment_queue_) { - if (scroller) { - DCHECK(scroller->GetScrollAnchor()); + // TODO(bokan): GetScrollAnchor() should never return nullptr but this is a + // speculative fix to see if it stops crashes seen in crbug.com/745686. + if (scroller && scroller->GetScrollAnchor()) scroller->GetScrollAnchor()->Adjust(); - } } anchoring_adjustment_queue_.clear(); }
diff --git a/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp index 0b9e98e..36d1da62 100644 --- a/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp +++ b/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
@@ -2094,7 +2094,7 @@ void WebLocalFrameImpl::SetHasReceivedUserGesture() { if (GetFrame()) - GetFrame()->SetDocumentHasReceivedUserGesture(); + GetFrame()->UpdateUserActivationInFrameTree(); } void WebLocalFrameImpl::BlinkFeatureUsageReport(const std::set<int>& features) {
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp index 7932f3a..cdb5b2e 100644 --- a/third_party/WebKit/Source/core/input/EventHandler.cpp +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -624,8 +624,8 @@ return result; } - UserGestureIndicator gesture_indicator( - UserGestureToken::Create(frame_->GetDocument())); + std::unique_ptr<UserGestureIndicator> gesture_indicator = + LocalFrame::CreateUserGesture(frame_); frame_->LocalFrameRoot() .GetEventHandler() .last_mouse_down_user_gesture_token_ = @@ -1007,8 +1007,7 @@ .GetEventHandler() .last_mouse_down_user_gesture_token_))); } else { - gesture_indicator = WTF::WrapUnique(new UserGestureIndicator( - UserGestureToken::Create(frame_->GetDocument()))); + gesture_indicator = LocalFrame::CreateUserGesture(frame_); } WebInputEventResult event_result = UpdatePointerTargetAndDispatchEvents(
diff --git a/third_party/WebKit/Source/core/layout/ScrollbarsTest.cpp b/third_party/WebKit/Source/core/layout/ScrollbarsTest.cpp index 7e787a1..fd5d223 100644 --- a/third_party/WebKit/Source/core/layout/ScrollbarsTest.cpp +++ b/third_party/WebKit/Source/core/layout/ScrollbarsTest.cpp
@@ -241,10 +241,6 @@ return WebSize(); } } - void GetOverlayScrollbarStyle(ScrollbarStyle* style) override { - style->thumb_thickness = 3; - style->scrollbar_margin = 0; - } static constexpr int kMinimumHorizontalLength = 51; static constexpr int kMinimumVerticalLength = 52; }; @@ -289,38 +285,6 @@ EXPECT_EQ(StubWebThemeEngine::kMinimumVerticalLength, theme.ThumbLength(*scrollable_area->VerticalScrollbar())); } - -// Ensure thumb position is correctly calculated even at ridiculously large -// scales. -TEST_P(ScrollbarAppearanceTest, HugeScrollingThumbPosition) { - ScopedTestingPlatformSupport<ScrollbarTestingPlatformSupport> platform; - - v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); - WebView().Resize(WebSize(1000, 1000)); - SimRequest request("https://example.com/test.html", "text/html"); - LoadURL("https://example.com/test.html"); - request.Complete( - "<style> body { margin: 0px; height: 10000000px; } </style>"); - ScrollableArea* scrollable_area = - GetDocument().View()->LayoutViewportScrollableArea(); - - Compositor().BeginFrame(); - - scrollable_area->SetScrollOffset(ScrollOffset(0, 10000000), - kProgrammaticScroll); - - int scroll_y = scrollable_area->GetScrollOffset().Height(); - ASSERT_EQ(9999000, scroll_y); - - Scrollbar* scrollbar = scrollable_area->VerticalScrollbar(); - ASSERT_TRUE(scrollbar); - - int maximumThumbPosition = - WebView().Size().height - StubWebThemeEngine::kMinimumVerticalLength; - - EXPECT_EQ(maximumThumbPosition, - scrollbar->GetTheme().ThumbPosition(*scrollbar)); -} #endif } // namespace
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.cpp b/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.cpp index 731981d..9d0039d 100644 --- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.cpp
@@ -84,6 +84,13 @@ .GlobalRootScroller(); } +bool IsEffective(const PaintLayer& layer) { + if (!layer.GetLayoutBox()) + return false; + + return IsEffective(*layer.GetLayoutBox()); +} + bool IsGlobal(const PaintLayer& layer) { if (!layer.GetLayoutBox()) return false;
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.h b/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.h index 9678ef0..c35766a 100644 --- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.h +++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.h
@@ -28,6 +28,7 @@ // Document. See |effective root scroller| in README.md. Note: a root scroller // always establishes a PaintLayer. bool IsEffective(const LayoutBox&); +bool IsEffective(const PaintLayer&); bool IsGlobal(const LayoutBox&); bool IsGlobal(const PaintLayer&);
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp index 2edb80f..6521afb 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -66,6 +66,7 @@ #include "core/layout/svg/LayoutSVGResourceClipper.h" #include "core/layout/svg/LayoutSVGRoot.h" #include "core/page/Page.h" +#include "core/page/scrolling/RootScrollerUtil.h" #include "core/page/scrolling/ScrollingCoordinator.h" #include "core/page/scrolling/StickyPositionScrollingConstraints.h" #include "core/paint/BoxReflectionUtils.h" @@ -2527,7 +2528,7 @@ LayoutRect PaintLayer::LogicalBoundingBox() const { LayoutRect rect = GetLayoutObject().VisualOverflowRect(); - if (IsRootLayer()) { + if (RootScrollerUtil::IsEffective(*this) || IsRootLayer()) { rect.Unite(LayoutRect(rect.Location(), GetLayoutObject().View()->ViewRect().Size())); } @@ -2648,14 +2649,14 @@ !HasVisibleDescendant()) return LayoutRect(); - if (IsRootLayer()) { + if (RootScrollerUtil::IsEffective(*this) || IsRootLayer()) { // In root layer scrolling mode, the main GraphicsLayer is the size of the // layout viewport. In non-RLS mode, it is the union of the layout viewport // and the document's layout overflow rect. IntRect result = IntRect(); if (LocalFrameView* frame_view = GetLayoutObject().GetFrameView()) result = IntRect(IntPoint(), frame_view->VisibleContentSize()); - if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) + if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled() && IsRootLayer()) result.Unite(GetLayoutObject().View()->DocumentRect()); return LayoutRect(result); }
diff --git a/third_party/WebKit/Source/devtools/front_end/inspector.html b/third_party/WebKit/Source/devtools/front_end/inspector.html index 0fec77e5..0798c34 100644 --- a/third_party/WebKit/Source/devtools/front_end/inspector.html +++ b/third_party/WebKit/Source/devtools/front_end/inspector.html
@@ -8,6 +8,7 @@ <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com"> + <meta name="referrer" content="no-referrer"> <script type="text/javascript" src="Runtime.js"></script> <script type="text/javascript" src="inspector.js"></script> </head>
diff --git a/third_party/WebKit/Source/modules/accessibility/AXEnums.cpp b/third_party/WebKit/Source/modules/accessibility/AXEnums.cpp index 600264d..f3ad82b0 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXEnums.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXEnums.cpp
@@ -25,7 +25,6 @@ STATIC_ASSERT_ENUM(kWebAXRoleAudio, kAudioRole); STATIC_ASSERT_ENUM(kWebAXRoleBanner, kBannerRole); STATIC_ASSERT_ENUM(kWebAXRoleBlockquote, kBlockquoteRole); -STATIC_ASSERT_ENUM(kWebAXRoleBusyIndicator, kBusyIndicatorRole); STATIC_ASSERT_ENUM(kWebAXRoleButton, kButtonRole); STATIC_ASSERT_ENUM(kWebAXRoleCanvas, kCanvasRole); STATIC_ASSERT_ENUM(kWebAXRoleCaption, kCaptionRole); @@ -61,7 +60,6 @@ STATIC_ASSERT_ENUM(kWebAXRoleIframe, kIframeRole); STATIC_ASSERT_ENUM(kWebAXRoleIframePresentational, kIframePresentationalRole); STATIC_ASSERT_ENUM(kWebAXRoleIgnored, kIgnoredRole); -STATIC_ASSERT_ENUM(kWebAXRoleImageMapLink, kImageMapLinkRole); STATIC_ASSERT_ENUM(kWebAXRoleImageMap, kImageMapRole); STATIC_ASSERT_ENUM(kWebAXRoleImage, kImageRole); STATIC_ASSERT_ENUM(kWebAXRoleInlineTextBox, kInlineTextBoxRole); @@ -92,7 +90,6 @@ STATIC_ASSERT_ENUM(kWebAXRoleNavigation, kNavigationRole); STATIC_ASSERT_ENUM(kWebAXRoleNone, kNoneRole); STATIC_ASSERT_ENUM(kWebAXRoleNote, kNoteRole); -STATIC_ASSERT_ENUM(kWebAXRoleOutline, kOutlineRole); STATIC_ASSERT_ENUM(kWebAXRoleParagraph, kParagraphRole); STATIC_ASSERT_ENUM(kWebAXRolePopUpButton, kPopUpButtonRole); STATIC_ASSERT_ENUM(kWebAXRolePre, kPreRole); @@ -101,15 +98,11 @@ STATIC_ASSERT_ENUM(kWebAXRoleRadioButton, kRadioButtonRole); STATIC_ASSERT_ENUM(kWebAXRoleRadioGroup, kRadioGroupRole); STATIC_ASSERT_ENUM(kWebAXRoleRegion, kRegionRole); -STATIC_ASSERT_ENUM(kWebAXRoleRootWebArea, kRootWebAreaRole); STATIC_ASSERT_ENUM(kWebAXRoleRowHeader, kRowHeaderRole); STATIC_ASSERT_ENUM(kWebAXRoleRow, kRowRole); STATIC_ASSERT_ENUM(kWebAXRoleRuby, kRubyRole); -STATIC_ASSERT_ENUM(kWebAXRoleRuler, kRulerRole); STATIC_ASSERT_ENUM(kWebAXRoleSVGRoot, kSVGRootRole); -STATIC_ASSERT_ENUM(kWebAXRoleScrollArea, kScrollAreaRole); STATIC_ASSERT_ENUM(kWebAXRoleScrollBar, kScrollBarRole); -STATIC_ASSERT_ENUM(kWebAXRoleSeamlessWebArea, kSeamlessWebAreaRole); STATIC_ASSERT_ENUM(kWebAXRoleSearch, kSearchRole); STATIC_ASSERT_ENUM(kWebAXRoleSearchBox, kSearchBoxRole); STATIC_ASSERT_ENUM(kWebAXRoleSlider, kSliderRole); @@ -120,7 +113,6 @@ STATIC_ASSERT_ENUM(kWebAXRoleStaticText, kStaticTextRole); STATIC_ASSERT_ENUM(kWebAXRoleStatus, kStatusRole); STATIC_ASSERT_ENUM(kWebAXRoleSwitch, kSwitchRole); -STATIC_ASSERT_ENUM(kWebAXRoleTabGroup, kTabGroupRole); STATIC_ASSERT_ENUM(kWebAXRoleTabList, kTabListRole); STATIC_ASSERT_ENUM(kWebAXRoleTabPanel, kTabPanelRole); STATIC_ASSERT_ENUM(kWebAXRoleTab, kTabRole); @@ -139,7 +131,6 @@ STATIC_ASSERT_ENUM(kWebAXRoleUserInterfaceTooltip, kUserInterfaceTooltipRole); STATIC_ASSERT_ENUM(kWebAXRoleVideo, kVideoRole); STATIC_ASSERT_ENUM(kWebAXRoleWebArea, kWebAreaRole); -STATIC_ASSERT_ENUM(kWebAXRoleWindow, kWindowRole); STATIC_ASSERT_ENUM(WebAXDefaultActionVerb::kActivate, AXDefaultActionVerb::kActivate);
diff --git a/third_party/WebKit/Source/modules/accessibility/AXEnums.h b/third_party/WebKit/Source/modules/accessibility/AXEnums.h index 8b681505..73ea4ce 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXEnums.h +++ b/third_party/WebKit/Source/modules/accessibility/AXEnums.h
@@ -21,7 +21,6 @@ kAudioRole, // No mapping to ARIA role. kBannerRole, kBlockquoteRole, // No mapping to ARIA role. - kBusyIndicatorRole, // No mapping to ARIA role. kButtonRole, kCanvasRole, // No mapping to ARIA role. kCaptionRole, // No mapping to ARIA role. @@ -57,7 +56,6 @@ kIframePresentationalRole, // No mapping to ARIA role. kIframeRole, // No mapping to ARIA role. kIgnoredRole, // No mapping to ARIA role. - kImageMapLinkRole, // No mapping to ARIA role. kImageMapRole, // No mapping to ARIA role. kImageRole, kInlineTextBoxRole, // No mapping to ARIA role. @@ -88,7 +86,6 @@ kNavigationRole, kNoneRole, // ARIA role of "none" kNoteRole, - kOutlineRole, // No mapping to ARIA role. kParagraphRole, // No mapping to ARIA role. kPopUpButtonRole, kPreRole, // No mapping to ARIA role. @@ -97,15 +94,11 @@ kRadioButtonRole, kRadioGroupRole, kRegionRole, - kRootWebAreaRole, // No mapping to ARIA role. kRowHeaderRole, kRowRole, kRubyRole, // No mapping to ARIA role. - kRulerRole, // No mapping to ARIA role. kSVGRootRole, // No mapping to ARIA role. - kScrollAreaRole, // No mapping to ARIA role. kScrollBarRole, - kSeamlessWebAreaRole, // No mapping to ARIA role. kSearchRole, kSearchBoxRole, kSliderRole, @@ -116,7 +109,6 @@ kStaticTextRole, // No mapping to ARIA role. kStatusRole, kSwitchRole, - kTabGroupRole, // No mapping to ARIA role. kTabListRole, kTabPanelRole, kTabRole, @@ -134,7 +126,6 @@ kUserInterfaceTooltipRole, kVideoRole, // No mapping to ARIA role. kWebAreaRole, // No mapping to ARIA role. - kWindowRole, // No mapping to ARIA role. kNumRoles };
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp index 804a336..b30ce21 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
@@ -164,8 +164,6 @@ {kAudioRole, "Audio"}, {kBannerRole, "Banner"}, {kBlockquoteRole, "Blockquote"}, - // TODO(nektar): Delete busy_indicator role. It's used nowhere. - {kBusyIndicatorRole, "BusyIndicator"}, {kButtonRole, "Button"}, {kCanvasRole, "Canvas"}, {kCaptionRole, "Caption"}, @@ -201,7 +199,6 @@ {kIframePresentationalRole, "IframePresentational"}, {kIframeRole, "Iframe"}, {kIgnoredRole, "Ignored"}, - {kImageMapLinkRole, "ImageMapLink"}, {kImageMapRole, "ImageMap"}, {kImageRole, "Image"}, {kInlineTextBoxRole, "InlineTextBox"}, @@ -232,7 +229,6 @@ {kNavigationRole, "Navigation"}, {kNoneRole, "None"}, {kNoteRole, "Note"}, - {kOutlineRole, "Outline"}, {kParagraphRole, "Paragraph"}, {kPopUpButtonRole, "PopUpButton"}, {kPreRole, "Pre"}, @@ -241,15 +237,11 @@ {kRadioButtonRole, "RadioButton"}, {kRadioGroupRole, "RadioGroup"}, {kRegionRole, "Region"}, - {kRootWebAreaRole, "RootWebArea"}, {kRowHeaderRole, "RowHeader"}, {kRowRole, "Row"}, {kRubyRole, "Ruby"}, - {kRulerRole, "Ruler"}, {kSVGRootRole, "SVGRoot"}, - {kScrollAreaRole, "ScrollArea"}, {kScrollBarRole, "ScrollBar"}, - {kSeamlessWebAreaRole, "SeamlessWebArea"}, {kSearchRole, "Search"}, {kSearchBoxRole, "SearchBox"}, {kSliderRole, "Slider"}, @@ -260,7 +252,6 @@ {kStaticTextRole, "StaticText"}, {kStatusRole, "Status"}, {kSwitchRole, "Switch"}, - {kTabGroupRole, "TabGroup"}, {kTabListRole, "TabList"}, {kTabPanelRole, "TabPanel"}, {kTabRole, "Tab"}, @@ -277,8 +268,7 @@ {kTreeRole, "Tree"}, {kUserInterfaceTooltipRole, "UserInterfaceTooltip"}, {kVideoRole, "Video"}, - {kWebAreaRole, "WebArea"}, - {kWindowRole, "Window"}}; + {kWebAreaRole, "WebArea"}}; static_assert(WTF_ARRAY_LENGTH(kInternalRoles) == kNumRoles, "Not all internal roles have an entry in internalRoles array"); @@ -624,7 +614,6 @@ case kCheckBoxRole: case kColorWellRole: case kComboBoxRole: - case kImageMapLinkRole: case kLinkRole: case kListBoxOptionRole: case kMenuButtonRole: @@ -2035,10 +2024,8 @@ case kMeterRole: case kNavigationRole: case kNoteRole: - case kOutlineRole: case kProgressIndicatorRole: case kRadioGroupRole: - case kRootWebAreaRole: case kScrollBarRole: case kSearchRole: case kSearchBoxRole: @@ -2046,14 +2033,11 @@ case kSliderRole: case kSpinButtonRole: case kStatusRole: - case kScrollAreaRole: - case kSeamlessWebAreaRole: case kSliderThumbRole: case kSpinButtonPartRole: case kSVGRootRole: case kTableRole: case kTableHeaderContainerRole: - case kTabGroupRole: case kTabListRole: case kTabPanelRole: case kTermRole: @@ -2065,7 +2049,6 @@ case kTreeGridRole: case kVideoRole: case kWebAreaRole: - case kWindowRole: result = false; break; @@ -2074,7 +2057,6 @@ // only have their own name if they are focusable case kAbbrRole: case kAnnotationRole: - case kBusyIndicatorRole: case kCanvasRole: case kCaptionRole: case kDescriptionListDetailRole: @@ -2085,7 +2067,6 @@ case kFooterRole: case kGenericContainerRole: case kIgnoredRole: - case kImageMapLinkRole: case kImageMapRole: case kInlineTextBoxRole: case kLabelRole: @@ -2104,7 +2085,6 @@ // if the row might receive focus case kRowRole: case kRubyRole: - case kRulerRole: result = recursive || (CanReceiveAccessibilityFocus() && !IsEditable()); break;
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp index eba1519..46de1f9f 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
@@ -10,6 +10,8 @@ #include "core/CSSPropertyNames.h" #include "core/css/CSSSyntaxDescriptor.h" #include "core/dom/ExceptionCode.h" +#include "core/frame/LocalDOMWindow.h" +#include "core/frame/LocalFrame.h" #include "core/inspector/MainThreadDebugger.h" #include "modules/csspaint/CSSPaintDefinition.h" #include "modules/csspaint/CSSPaintImageGeneratorImpl.h" @@ -241,6 +243,10 @@ return paint_definitions_.at(name); } +double PaintWorkletGlobalScope::devicePixelRatio() const { + return GetFrame()->DevicePixelRatio(); +} + DEFINE_TRACE(PaintWorkletGlobalScope) { visitor->Trace(paint_definitions_); visitor->Trace(pending_generator_registry_);
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h index b2291706..c0ffe68a 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
@@ -40,6 +40,7 @@ ExceptionState&); CSSPaintDefinition* FindDefinition(const String& name); + double devicePixelRatio() const; DECLARE_VIRTUAL_TRACE(); DECLARE_TRACE_WRAPPERS();
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.idl b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.idl index 3770858..88bfdc1 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.idl +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.idl
@@ -9,5 +9,6 @@ Global=(Worklet,PaintWorklet), RuntimeEnabled=CSSPaintAPI ] interface PaintWorkletGlobalScope : WorkletGlobalScope { + readonly attribute unrestricted double devicePixelRatio; [RaisesException] void registerPaint(DOMString name, Function paintCtor); };
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp index 41008fc..06b9946 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp +++ b/third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp
@@ -82,9 +82,7 @@ if (!context->GetSecurityOrigin()->IsSameSchemeHostPortAndSuborigin( SecurityOrigin::Create(parsed_url_to_open).Get())) { - resolver->Reject(DOMException::Create( - kSecurityError, - "'" + parsed_url_to_open.ElidedString() + "' is not allowed.")); + resolver->Resolve(v8::Null(script_state->GetIsolate())); return promise; }
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContextTest.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContextTest.cpp index 072211a..c116657 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContextTest.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContextTest.cpp
@@ -625,7 +625,7 @@ // document previous received a user gesture. TEST_P(BaseAudioContextAutoplayTest, AutoplayMetrics_DocumentReceivedGesture_Child) { - ChildDocument().GetFrame()->SetDocumentHasReceivedUserGesture(); + ChildDocument().GetFrame()->UpdateUserActivationInFrameTree(); BaseAudioContext* audio_context = BaseAudioContext::Create( ChildDocument(), AudioContextOptions(), ASSERT_NO_EXCEPTION); @@ -661,7 +661,7 @@ // document previous received a user gesture. TEST_P(BaseAudioContextAutoplayTest, AutoplayMetrics_DocumentReceivedGesture_Main) { - GetDocument().GetFrame()->SetDocumentHasReceivedUserGesture(); + GetDocument().GetFrame()->UpdateUserActivationInFrameTree(); BaseAudioContext* audio_context = BaseAudioContext::Create( GetDocument(), AudioContextOptions(), ASSERT_NO_EXCEPTION);
diff --git a/third_party/WebKit/Source/platform/BUILD.gn b/third_party/WebKit/Source/platform/BUILD.gn index c19880f6..216c93c 100644 --- a/third_party/WebKit/Source/platform/BUILD.gn +++ b/third_party/WebKit/Source/platform/BUILD.gn
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/buildflag_header.gni") import("//build/config/features.gni") import("//build/config/ui.gni") import("//testing/libfuzzer/fuzzer_test.gni") @@ -206,6 +207,18 @@ ] } +declare_args() { + runtime_call_stats_count_everything = false +} + +buildflag_header("rcs_count_everything") { + header = "RuntimeCallStatsCountEverything.h" + + header_dir = "blink/platform/bindings" + + flags = [ "RCS_COUNT_EVERYTHING=$runtime_call_stats_count_everything" ] +} + config("blink_platform_implementation") { defines = [ "BLINK_PLATFORM_IMPLEMENTATION=1" ] } @@ -1476,6 +1489,7 @@ public_deps = [ ":make_platform_generated", + ":rcs_count_everything", "//base", "//cc", "//cc/animation",
diff --git a/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.cpp b/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.cpp index 3617883..d9bd6c29c 100644 --- a/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.cpp +++ b/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.cpp
@@ -23,7 +23,7 @@ RuntimeCallStats* g_runtime_call_stats_for_testing = nullptr; } -void RuntimeCallCounter::Dump(TracedValue& value) { +void RuntimeCallCounter::Dump(TracedValue& value) const { value.BeginArray(name_); value.PushDouble(count_); value.PushDouble(time_.InMicroseconds()); @@ -74,13 +74,30 @@ for (int i = 0; i < number_of_counters_; i++) { counters_[i].Reset(); } + +#if BUILDFLAG(RCS_COUNT_EVERYTHING) + for (const auto& counter : counter_map_.Values()) { + counter->Reset(); + } +#endif } -void RuntimeCallStats::Dump(TracedValue& value) { +void RuntimeCallStats::Dump(TracedValue& value) const { for (int i = 0; i < number_of_counters_; i++) { if (counters_[i].GetCount() > 0) counters_[i].Dump(value); } + +#if BUILDFLAG(RCS_COUNT_EVERYTHING) + for (const auto& counter : counter_map_.Values()) { + if (counter->GetCount() > 0) + counter->Dump(value); + } +#endif +} + +namespace { +const char row_format[] = "%-55s %8" PRIu64 " %9.3f\n"; } String RuntimeCallStats::ToString() const { @@ -91,10 +108,15 @@ "(ms)\n\n"); for (int i = 0; i < number_of_counters_; i++) { const RuntimeCallCounter* counter = &counters_[i]; - builder.Append(String::Format("%-55s %8" PRIu64 " %9.3f\n", - counter->GetName(), counter->GetCount(), + builder.Append(String::Format(row_format, counter->GetName(), + counter->GetCount(), counter->GetTime().InMillisecondsF())); } + +#if BUILDFLAG(RCS_COUNT_EVERYTHING) + AddCounterMapStatsToBuilder(builder); +#endif + return builder.ToString(); } @@ -110,6 +132,41 @@ g_runtime_call_stats_for_testing = nullptr; } +#if BUILDFLAG(RCS_COUNT_EVERYTHING) +RuntimeCallCounter* RuntimeCallStats::GetCounter(const char* name) { + CounterMap::iterator it = counter_map_.find(name); + if (it != counter_map_.end()) + return it->value.get(); + return counter_map_.insert(name, WTF::MakeUnique<RuntimeCallCounter>(name)) + .stored_value->value.get(); +} + +Vector<RuntimeCallCounter*> RuntimeCallStats::CounterMapToSortedArray() const { + Vector<RuntimeCallCounter*> counters; + for (const auto& counter : counter_map_.Values()) { + counters.push_back(counter.get()); + } + auto comparator = [](RuntimeCallCounter* a, RuntimeCallCounter* b) { + return a->GetCount() == b->GetCount() + ? strcmp(a->GetName(), b->GetName()) < 0 + : a->GetCount() < b->GetCount(); + }; + std::sort(counters.begin(), counters.end(), comparator); + return counters; +} + +void RuntimeCallStats::AddCounterMapStatsToBuilder( + StringBuilder& builder) const { + builder.Append(String::Format("\nNumber of counters in map: %u\n\n", + counter_map_.size())); + for (RuntimeCallCounter* counter : CounterMapToSortedArray()) { + builder.Append(String::Format(row_format, counter->GetName(), + counter->GetCount(), + counter->GetTime().InMillisecondsF())); + } +} +#endif + const char* const RuntimeCallStatsScopedTracer::s_category_group_ = TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats"); const char* const RuntimeCallStatsScopedTracer::s_name_ =
diff --git a/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.h b/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.h index fee0731..27c1d77 100644 --- a/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.h +++ b/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.h
@@ -10,6 +10,7 @@ #include "platform/PlatformExport.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/bindings/RuntimeCallStatsCountEverything.h" #include "platform/instrumentation/tracing/TraceEvent.h" #include "platform/instrumentation/tracing/TracedValue.h" #include "platform/wtf/Allocator.h" @@ -40,7 +41,7 @@ count_ = 0; } - void Dump(TracedValue&); + void Dump(TracedValue&) const; private: RuntimeCallCounter() {} @@ -139,6 +140,18 @@ rcs_scope, RuntimeCallStats::From(isolate), counterId) \ } +// Used in places which do not have a counter explicitly defined in +// FOR_EACH_COUNTER. This is a no-op by default (when RCS_COUNT_EVERYTHING is +// not set). +#if BUILDFLAG(RCS_COUNT_EVERYTHING) +#define RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(isolate, counterName) \ + RUNTIME_CALL_TIMER_SCOPE(isolate, counterName) +#else +#define RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(isolate, counterName) \ + do { \ + } while (false) +#endif + // Maintains a stack of timers and provides functions to manage recording scopes // by pausing and resuming timers in the chain when entering and leaving a // scope. @@ -222,6 +235,13 @@ current_timer_ = timer; } +#if BUILDFLAG(RCS_COUNT_EVERYTHING) + void Enter(RuntimeCallTimer* timer, const char* id) { + timer->Start(GetCounter(id), current_timer_); + current_timer_ = timer; + } +#endif + // Exits the current recording scope, by stopping <timer> (and updating the // counter associated with <timer>) and resuming the timer that was paused // before entering the current scope. @@ -234,7 +254,7 @@ // Reset all the counters. void Reset(); - void Dump(TracedValue&); + void Dump(TracedValue&) const; bool InUse() const { return in_use_; } void SetInUse(bool in_use) { in_use_ = in_use; } @@ -248,12 +268,26 @@ static void SetRuntimeCallStatsForTesting(); static void ClearRuntimeCallStatsForTesting(); +#if BUILDFLAG(RCS_COUNT_EVERYTHING) + // Look up counter in counter map. If counter doesn't exist, a new counter is + // created and inserted into the map. + RuntimeCallCounter* GetCounter(const char* name); +#endif + private: RuntimeCallTimer* current_timer_ = nullptr; bool in_use_ = false; RuntimeCallCounter counters_[static_cast<int>(CounterId::kNumberOfCounters)]; static const int number_of_counters_ = static_cast<int>(CounterId::kNumberOfCounters); + +#if BUILDFLAG(RCS_COUNT_EVERYTHING) + typedef HashMap<const char*, std::unique_ptr<RuntimeCallCounter>> CounterMap; + CounterMap counter_map_; + + Vector<RuntimeCallCounter*> CounterMapToSortedArray() const; + void AddCounterMapStatsToBuilder(StringBuilder&) const; +#endif }; // A utility class that creates a RuntimeCallTimer and uses it with @@ -266,6 +300,12 @@ : call_stats_(stats) { call_stats_->Enter(&timer_, counter); } +#if BUILDFLAG(RCS_COUNT_EVERYTHING) + RuntimeCallTimerScope(RuntimeCallStats* stats, const char* counterName) + : call_stats_(stats) { + call_stats_->Enter(&timer_, counterName); + } +#endif ~RuntimeCallTimerScope() { call_stats_->Leave(&timer_); } private:
diff --git a/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.md b/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.md new file mode 100644 index 0000000..ee2b82e --- /dev/null +++ b/third_party/WebKit/Source/platform/bindings/RuntimeCallStats.md
@@ -0,0 +1,23 @@ +# Runtime Call Stats + +## About + +RuntimeCallStats is a group of counters used to track execution times and call counts of functions in Blink during JS Execution. V8 has its own corresponding implementation of RuntimeCallStats, which is closely mirrored by Blink. Blink's implementation can be found in [RuntimeCallStats.h](RuntimeCallStats.h) and [RuntimeCallStats.cpp](RuntimeCallStats.cpp). + +## Usage + +Counters can be added by adding a name under FOR_EACH_COUNTER in RuntimeCallStats.h and by using the RUNTIME_CALL_TIMER_SCOPE, RUNTIME_CALL_STATS_ENTER and RUNTIME_CALL_STATS_LEAVE macros. See documentation in [RuntimeCallStats.h](RuntimeCallStats.h) for more details. + +Counters can also be directly added to the bindings layer in method and attribute callbacks by using the `[RuntimeCallStatsCounter]` IDL extended attribute (see [IDLExtendedAttributes.md](../../bindings/IDLExtendedAttributes.md#RuntimeCallStatsCounter_m_a) for more details). + +## Viewing Results + +Results can be seen through [chrome tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool). Run chrome with `--enable-blink-features=BlinkRuntimeCallStats`, and record a trace. Be sure to enable the `v8` and `v8.runtime_stats` (which is disabled by default) categories under 'Manually select settings'. After recording a trace, select the events recorded (for the website being analyzed) and click on 'Runtime call stats table'. The Blink runtime call stats should be visible below the V8 call stats table. + +Alternatively, running chrome as follows `chrome --enable-blink-features=BlinkRuntimeCallStats --dump-blink-runtime-call-stats --single-process` will dump call stats to the logs when the browser is closed. Adding `--enable-logging=stderr` will display log output in stderr. + +## RCS_COUNT_EVERYTHING + +Adding `rcs_count_everything = true` to a gn args file creates a special build where counters are added in the bindings layer to most Blink callbacks that are called by V8. This gives a more thorough breakdown of where time is spent executing Blink C++ during JS Execution. + +It is disabled by default (and behind a compile time flag) as it adds a large number of counters (> 2000) which causes a significant increase in binary size. There is also a performance hit when RCS is enabled with this build due to the large number of counters and counters added to some very trivial getters and setters.
diff --git a/third_party/WebKit/Source/platform/bindings/V8ObjectConstructor.cpp b/third_party/WebKit/Source/platform/bindings/V8ObjectConstructor.cpp index 07499538..b531c414 100644 --- a/third_party/WebKit/Source/platform/bindings/V8ObjectConstructor.cpp +++ b/third_party/WebKit/Source/platform/bindings/V8ObjectConstructor.cpp
@@ -50,6 +50,8 @@ void V8ObjectConstructor::IsValidConstructorMode( const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), + "Blink_IsValidConstructorMode"); if (ConstructorMode::Current(info.GetIsolate()) == ConstructorMode::kCreateNewObject) { V8ThrowException::ThrowTypeError(info.GetIsolate(), "Illegal constructor");
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp index 2e4aa07f..ed205a6 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp +++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp
@@ -103,6 +103,17 @@ return style.fade_out_duration_seconds; } +int ScrollbarThemeOverlay::ThumbPosition(const ScrollbarThemeClient& scrollbar, + float scroll_position) { + if (!scrollbar.TotalSize()) + return 0; + + int track_len = TrackLength(scrollbar); + float proportion = + static_cast<float>(scroll_position) / scrollbar.TotalSize(); + return round(proportion * track_len); +} + int ScrollbarThemeOverlay::ThumbLength(const ScrollbarThemeClient& scrollbar) { int track_len = TrackLength(scrollbar);
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.h b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.h index c82d5666..8a95f522 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.h +++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.h
@@ -59,6 +59,8 @@ double OverlayScrollbarFadeOutDelaySeconds() const override; double OverlayScrollbarFadeOutDurationSeconds() const override; + int ThumbPosition(const ScrollbarThemeClient&, + float scroll_position) override; int ThumbLength(const ScrollbarThemeClient&) override; bool HasButtons(const ScrollbarThemeClient&) override { return false; }
diff --git a/third_party/WebKit/public/web/WebAXEnums.h b/third_party/WebKit/public/web/WebAXEnums.h index 630b2b2d..1ee2a9c9 100644 --- a/third_party/WebKit/public/web/WebAXEnums.h +++ b/third_party/WebKit/public/web/WebAXEnums.h
@@ -87,7 +87,6 @@ kWebAXRoleAudio, kWebAXRoleBanner, kWebAXRoleBlockquote, - kWebAXRoleBusyIndicator, kWebAXRoleButton, kWebAXRoleCanvas, kWebAXRoleCaption, @@ -123,7 +122,6 @@ kWebAXRoleIframePresentational, kWebAXRoleIframe, kWebAXRoleIgnored, - kWebAXRoleImageMapLink, kWebAXRoleImageMap, kWebAXRoleImage, kWebAXRoleInlineTextBox, @@ -154,7 +152,6 @@ kWebAXRoleNavigation, kWebAXRoleNone, kWebAXRoleNote, - kWebAXRoleOutline, kWebAXRoleParagraph, kWebAXRolePopUpButton, kWebAXRolePre, @@ -163,15 +160,11 @@ kWebAXRoleRadioButton, kWebAXRoleRadioGroup, kWebAXRoleRegion, - kWebAXRoleRootWebArea, kWebAXRoleRowHeader, kWebAXRoleRow, kWebAXRoleRuby, - kWebAXRoleRuler, kWebAXRoleSVGRoot, - kWebAXRoleScrollArea, kWebAXRoleScrollBar, - kWebAXRoleSeamlessWebArea, kWebAXRoleSearch, kWebAXRoleSearchBox, kWebAXRoleSlider, @@ -182,7 +175,6 @@ kWebAXRoleStaticText, kWebAXRoleStatus, kWebAXRoleSwitch, - kWebAXRoleTabGroup, kWebAXRoleTabList, kWebAXRoleTabPanel, kWebAXRoleTab, @@ -200,7 +192,6 @@ kWebAXRoleUserInterfaceTooltip, kWebAXRoleVideo, kWebAXRoleWebArea, - kWebAXRoleWindow, }; enum class WebAXDefaultActionVerb {
diff --git a/third_party/android_system_sdk/README.chromium b/third_party/android_system_sdk/README.chromium index 4674a80..96fdfcc 100644 --- a/third_party/android_system_sdk/README.chromium +++ b/third_party/android_system_sdk/README.chromium
@@ -1,7 +1,7 @@ Name: Android System SDK Short Name: Android System SDK Version: 0 -Revision: 3562008 +Revision: OPR1.170623.015 License: GPL v2 License File: LICENSE Security Critical: No
diff --git a/third_party/android_system_sdk/android-stubs-src.jar.sha1 b/third_party/android_system_sdk/android-stubs-src.jar.sha1 index 10316dc..e2920c2 100644 --- a/third_party/android_system_sdk/android-stubs-src.jar.sha1 +++ b/third_party/android_system_sdk/android-stubs-src.jar.sha1
@@ -1 +1 @@ -b75f623c98f2b671b3ddedc14c7f94818b969bc7 +2d660356a1473c93a0b8e08406a8ebb3722d8a20
diff --git a/third_party/android_system_sdk/android_system.jar.sha1 b/third_party/android_system_sdk/android_system.jar.sha1 index e85537e..6a1ea22c 100644 --- a/third_party/android_system_sdk/android_system.jar.sha1 +++ b/third_party/android_system_sdk/android_system.jar.sha1
@@ -1 +1 @@ -797f9a2146d33272fafb8582c3aea0550ac20891 +7ddf6745918ea48bc4bdb7c6802ee2bcebacd462
diff --git a/third_party/closure_compiler/externs/automation.js b/third_party/closure_compiler/externs/automation.js index b49057e9..14511c9 100644 --- a/third_party/closure_compiler/externs/automation.js +++ b/third_party/closure_compiler/externs/automation.js
@@ -85,7 +85,6 @@ AUDIO: 'audio', BANNER: 'banner', BLOCKQUOTE: 'blockquote', - BUSY_INDICATOR: 'busyIndicator', BUTTON: 'button', BUTTON_DROP_DOWN: 'buttonDropDown', CANVAS: 'canvas', @@ -125,7 +124,6 @@ IFRAME: 'iframe', IFRAME_PRESENTATIONAL: 'iframePresentational', IGNORED: 'ignored', - IMAGE_MAP_LINK: 'imageMapLink', IMAGE_MAP: 'imageMap', IMAGE: 'image', INLINE_TEXT_BOX: 'inlineTextBox', @@ -156,7 +154,6 @@ METER: 'meter', NAVIGATION: 'navigation', NOTE: 'note', - OUTLINE: 'outline', PANE: 'pane', PARAGRAPH: 'paragraph', POP_UP_BUTTON: 'popUpButton', @@ -170,11 +167,8 @@ ROW_HEADER: 'rowHeader', ROW: 'row', RUBY: 'ruby', - RULER: 'ruler', SVG_ROOT: 'svgRoot', - SCROLL_AREA: 'scrollArea', SCROLL_BAR: 'scrollBar', - SEAMLESS_WEB_AREA: 'seamlessWebArea', SEARCH: 'search', SEARCH_BOX: 'searchBox', SLIDER: 'slider', @@ -185,7 +179,6 @@ STATIC_TEXT: 'staticText', STATUS: 'status', SWITCH: 'switch', - TAB_GROUP: 'tabGroup', TAB_LIST: 'tabList', TAB_PANEL: 'tabPanel', TAB: 'tab',
diff --git a/third_party/libjingle_xmpp/BUILD.gn b/third_party/libjingle_xmpp/BUILD.gn index 75b93001..7f2cbd1 100644 --- a/third_party/libjingle_xmpp/BUILD.gn +++ b/third_party/libjingle_xmpp/BUILD.gn
@@ -12,6 +12,10 @@ ] } +config("libjingle_xmpp_common_config") { + defines = [ "EXPAT_RELATIVE_PATH" ] +} + rtc_static_library("rtc_task_runner") { sources = [ "task_runner/task.cc", @@ -47,6 +51,7 @@ public_deps = [ "//third_party/expat", ] + configs += [ ":libjingle_xmpp_common_config" ] } config("rtc_xmpp_warnings_config") { @@ -98,7 +103,10 @@ ":rtc_task_runner", "//third_party/expat", ] - configs += [ ":rtc_xmpp_warnings_config" ] + configs += [ + ":rtc_xmpp_warnings_config", + ":libjingle_xmpp_common_config", + ] if (is_nacl) { deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
diff --git a/tools/bisect-builds.py b/tools/bisect-builds.py index 2586814..588c811e3 100755 --- a/tools/bisect-builds.py +++ b/tools/bisect-builds.py
@@ -543,13 +543,14 @@ # Hack: Chrome OS archives are missing icudtl.dat; try to copy it from # the local directory. if context.platform == 'chromeos': - icudtl_path = 'third_party/icu/common/icudtl.dat' - if not os.access(icudtl_path, os.F_OK): - print 'Couldn\'t find: ' + icudtl_path - print ('The path might have changed. Please look for the data under ' - 'third_party/icu and update bisect-build.py') - sys.exit() - os.system('cp %s %s/chrome-linux/' % (icudtl_path, tempdir)) + if not os.access('%s/chrome-linux/icudtl.dat' % tempdir, os.F_OK): + icudtl_path = 'third_party/icu/common/icudtl.dat' + if not os.access(icudtl_path, os.F_OK): + print 'Couldn\'t find: ' + icudtl_path + print ('The path might have changed. Please look for the data under ' + 'third_party/icu and update bisect-build.py') + sys.exit() + os.system('cp %s %s/chrome-linux/' % (icudtl_path, tempdir)) os.chdir(tempdir)
diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py index 55500ad..41e4ae3 100755 --- a/tools/gn/bootstrap/bootstrap.py +++ b/tools/gn/bootstrap/bootstrap.py
@@ -20,6 +20,7 @@ import logging import optparse import os +import platform import shutil import subprocess import sys @@ -88,6 +89,13 @@ # Preserve the executable permission bit. shutil.copy2(out_gn, options.output) +def windows_target_build_arch(): + # Target build architecture set by vcvarsall.bat + target_arch = os.environ.get('Platform') + if target_arch in ['x64', 'x86']: return target_arch + + if platform.machine().lower() in ['x86_64', 'amd64']: return 'x64' + return 'x86' def main(argv): parser = optparse.OptionParser(description=sys.modules[__name__].__doc__) @@ -363,8 +371,12 @@ '/GR-', '/D_HAS_EXCEPTIONS=0', ]) - # TODO(tim): Support for 64bit builds? - ldflags.extend(['/MACHINE:x86', '/DEBUG']) + + target_arch = windows_target_build_arch() + if target_arch == 'x64': + ldflags.extend(['/MACHINE:x64']) + else: + ldflags.extend(['/MACHINE:x86']) static_libraries = { 'base': {'sources': [], 'tool': 'cxx', 'include_dirs': []}, @@ -436,6 +448,7 @@ 'base/memory/ref_counted_memory.cc', 'base/memory/singleton.cc', 'base/memory/shared_memory_handle.cc', + 'base/memory/shared_memory_tracker.cc', 'base/memory/weak_ptr.cc', 'base/message_loop/incoming_task_queue.cc', 'base/message_loop/message_loop.cc', @@ -566,6 +579,7 @@ 'base/unguessable_token.cc', 'base/value_iterators.cc', 'base/values.cc', + 'base/value_iterators.cc', 'base/vlog.cc', ]) @@ -797,6 +811,7 @@ 'version.lib', 'winmm.lib', 'ws2_32.lib', + 'Shlwapi.lib', ]) # we just build static libraries that GN needs
diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md index 4402316..2d7a0c0a7 100644 --- a/tools/gn/docs/reference.md +++ b/tools/gn/docs/reference.md
@@ -6090,6 +6090,13 @@ itself). ``` +#### **Shared libraries** + +``` + The results of shared_library targets are runtime dependencies, unless the + targets are depended upon only through action/action_foreach. +``` + #### **Multiple outputs** ``` @@ -6235,4 +6242,3 @@ * [-v: Verbose logging.](#-v) * [--version: Prints the GN version number and exits.](#--version) ``` -
diff --git a/tools/gn/runtime_deps.cc b/tools/gn/runtime_deps.cc index 14e13e3..05456178 100644 --- a/tools/gn/runtime_deps.cc +++ b/tools/gn/runtime_deps.cc
@@ -117,6 +117,13 @@ for (const auto& dep_pair : target->GetDeps(Target::DEPS_LINKED)) { if (dep_pair.ptr->output_type() == Target::EXECUTABLE) continue; // Skip executables that aren't data deps. + if (dep_pair.ptr->output_type() == Target::SHARED_LIBRARY && + (target->output_type() == Target::ACTION || + target->output_type() == Target::ACTION_FOREACH)) { + // Skip shared libraries that action depends on, + // unless it were listed in data deps. + continue; + } RecursiveCollectRuntimeDeps(dep_pair.ptr, false, deps, seen_targets, found_files); }
diff --git a/tools/gn/runtime_deps_unittest.cc b/tools/gn/runtime_deps_unittest.cc index c242ec6..ad1fbdcd 100644 --- a/tools/gn/runtime_deps_unittest.cc +++ b/tools/gn/runtime_deps_unittest.cc
@@ -165,6 +165,46 @@ << GetVectorDescription(result); } +TEST(RuntimeDeps, ActionSharedLib) { + TestWithScope setup; + Err err; + + // Dependency hierarchy: main(exe) -> action -> datadep(shared library) + // -> dep(shared library) + // Datadep should be included, dep should not be. + + Target dep(setup.settings(), Label(SourceDir("//"), "dep"), {}); + InitTargetWithType(setup, &dep, Target::SHARED_LIBRARY); + ASSERT_TRUE(dep.OnResolved(&err)); + + Target datadep(setup.settings(), Label(SourceDir("//"), "datadep"), {}); + InitTargetWithType(setup, &datadep, Target::SHARED_LIBRARY); + ASSERT_TRUE(datadep.OnResolved(&err)); + + Target action(setup.settings(), Label(SourceDir("//"), "action"), {}); + InitTargetWithType(setup, &action, Target::ACTION); + action.private_deps().push_back(LabelTargetPair(&dep)); + action.data_deps().push_back(LabelTargetPair(&datadep)); + action.action_values().outputs() = + SubstitutionList::MakeForTest("//action.output"); + ASSERT_TRUE(action.OnResolved(&err)); + + Target main(setup.settings(), Label(SourceDir("//"), "main"), {}); + InitTargetWithType(setup, &main, Target::EXECUTABLE); + main.private_deps().push_back(LabelTargetPair(&action)); + ASSERT_TRUE(main.OnResolved(&err)); + + std::vector<std::pair<OutputFile, const Target*>> result = + ComputeRuntimeDeps(&main); + + // The result should have deps of main and data_dep. + ASSERT_EQ(2u, result.size()) << GetVectorDescription(result); + + // The first one should always be the main exe. + EXPECT_TRUE(MakePair("./main", &main) == result[0]); + EXPECT_TRUE(MakePair("./libdatadep.so", &datadep) == result[1]); +} + // Tests that action and copy outputs are considered if they're data deps, but // not if they're regular deps. Action and copy "data" files are always // included.
diff --git a/tools/perf/benchmarks/smoothness.py b/tools/perf/benchmarks/smoothness.py index a790149..8b5cac5 100644 --- a/tools/perf/benchmarks/smoothness.py +++ b/tools/perf/benchmarks/smoothness.py
@@ -255,6 +255,19 @@ def SetExpectations(self): self.DisableStory('robohornetpro', [story_module.expectations.ALL], 'crbug.com/350692') + self.DisableStory( + 'balls_css_keyframe_animations_composited_transform.html', + [story_module.expectations.ALL_MOBILE], + 'crbug.com/755556') + self.DisableStory( + 'mix_blend_mode_animation_difference.html', + [story_module.expectations.ALL_MAC], + 'crbug.com/755556') + self.DisableStory( + 'mix_blend_mode_animation_hue.html', + [story_module.expectations.ALL_MAC], + 'crbug.com/755556') + return StoryExpectations()
diff --git a/ui/accessibility/ax_enums.idl b/ui/accessibility/ax_enums.idl index 4437905..6d19860 100644 --- a/ui/accessibility/ax_enums.idl +++ b/ui/accessibility/ax_enums.idl
@@ -86,8 +86,6 @@ audio, banner, blockquote, - // TODO(nektar): Remove busy_indicator because it's used nowhere. - busy_indicator, button, button_drop_down, // Not used on Web. canvas, @@ -127,7 +125,6 @@ iframe, iframe_presentational, ignored, - image_map_link, image_map, image, inline_text_box, @@ -158,7 +155,6 @@ meter, navigation, note, - outline, pane, paragraph, pop_up_button, @@ -172,11 +168,8 @@ row_header, row, ruby, - ruler, svg_root, - scroll_area, scroll_bar, - seamless_web_area, search, search_box, slider, @@ -187,7 +180,6 @@ static_text, status, switch, - tab_group, tab_list, tab_panel, tab,
diff --git a/ui/accessibility/ax_role_properties.cc b/ui/accessibility/ax_role_properties.cc index 34355fe..e0e4454 100644 --- a/ui/accessibility/ax_role_properties.cc +++ b/ui/accessibility/ax_role_properties.cc
@@ -12,7 +12,6 @@ case AX_ROLE_CHECK_BOX: case AX_ROLE_COLOR_WELL: case AX_ROLE_DISCLOSURE_TRIANGLE: - case AX_ROLE_IMAGE_MAP_LINK: case AX_ROLE_LINK: case AX_ROLE_LIST_BOX_OPTION: case AX_ROLE_MENU_BUTTON:
diff --git a/ui/accessibility/platform/ax_platform_node_mac.mm b/ui/accessibility/platform/ax_platform_node_mac.mm index 56dab4a..bb310eb 100644 --- a/ui/accessibility/platform/ax_platform_node_mac.mm +++ b/ui/accessibility/platform/ax_platform_node_mac.mm
@@ -36,7 +36,6 @@ {ui::AX_ROLE_AUDIO, NSAccessibilityGroupRole}, {ui::AX_ROLE_BANNER, NSAccessibilityGroupRole}, {ui::AX_ROLE_BLOCKQUOTE, NSAccessibilityGroupRole}, - {ui::AX_ROLE_BUSY_INDICATOR, NSAccessibilityBusyIndicatorRole}, {ui::AX_ROLE_BUTTON, NSAccessibilityButtonRole}, {ui::AX_ROLE_CANVAS, NSAccessibilityImageRole}, {ui::AX_ROLE_CAPTION, NSAccessibilityGroupRole}, @@ -79,7 +78,6 @@ {ui::AX_ROLE_IGNORED, NSAccessibilityUnknownRole}, {ui::AX_ROLE_IMAGE, NSAccessibilityImageRole}, {ui::AX_ROLE_IMAGE_MAP, NSAccessibilityGroupRole}, - {ui::AX_ROLE_IMAGE_MAP_LINK, NSAccessibilityLinkRole}, {ui::AX_ROLE_INPUT_TIME, @"AXTimeField"}, {ui::AX_ROLE_LABEL_TEXT, NSAccessibilityGroupRole}, {ui::AX_ROLE_LEGEND, NSAccessibilityGroupRole}, @@ -106,7 +104,6 @@ {ui::AX_ROLE_NAVIGATION, NSAccessibilityGroupRole}, {ui::AX_ROLE_NONE, NSAccessibilityGroupRole}, {ui::AX_ROLE_NOTE, NSAccessibilityGroupRole}, - {ui::AX_ROLE_OUTLINE, NSAccessibilityOutlineRole}, {ui::AX_ROLE_PARAGRAPH, NSAccessibilityGroupRole}, {ui::AX_ROLE_POP_UP_BUTTON, NSAccessibilityPopUpButtonRole}, {ui::AX_ROLE_PRE, NSAccessibilityGroupRole}, @@ -118,7 +115,6 @@ {ui::AX_ROLE_ROOT_WEB_AREA, @"AXWebArea"}, {ui::AX_ROLE_ROW, NSAccessibilityRowRole}, {ui::AX_ROLE_ROW_HEADER, @"AXCell"}, - {ui::AX_ROLE_RULER, NSAccessibilityRulerRole}, {ui::AX_ROLE_SCROLL_BAR, NSAccessibilityScrollBarRole}, {ui::AX_ROLE_SEARCH, NSAccessibilityGroupRole}, {ui::AX_ROLE_SEARCH_BOX, NSAccessibilityTextFieldRole}, @@ -148,10 +144,6 @@ {ui::AX_ROLE_VIDEO, NSAccessibilityGroupRole}, {ui::AX_ROLE_WEB_AREA, @"AXWebArea"}, {ui::AX_ROLE_WINDOW, NSAccessibilityWindowRole}, - - // TODO(dtseng): we don't correctly support the attributes for these - // roles. - // { ui::AX_ROLE_SCROLL_AREA, NSAccessibilityScrollAreaRole }, }; return RoleMap(begin(roles), end(roles));
diff --git a/ui/accessibility/platform/ax_platform_node_win.cc b/ui/accessibility/platform/ax_platform_node_win.cc index 0791043..88902b9 100644 --- a/ui/accessibility/platform/ax_platform_node_win.cc +++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -1005,8 +1005,7 @@ // // Links (Use AX_ATTR_URL) // - if (target->GetData().role == ui::AX_ROLE_LINK || - target->GetData().role == ui::AX_ROLE_IMAGE_MAP_LINK) { + if (target->GetData().role == ui::AX_ROLE_LINK) { result = target->GetString16Attribute(ui::AX_ATTR_URL); *value = SysAllocString(result.c_str()); DCHECK(*value); @@ -2378,9 +2377,6 @@ case ui::AX_ROLE_BANNER: return ROLE_SYSTEM_GROUPING; - case ui::AX_ROLE_BUSY_INDICATOR: - return ROLE_SYSTEM_ANIMATION; - case ui::AX_ROLE_BUTTON: return ROLE_SYSTEM_PUSHBUTTON; @@ -2475,9 +2471,6 @@ case ui::AX_ROLE_IMAGE: return ROLE_SYSTEM_GRAPHIC; - case ui::AX_ROLE_IMAGE_MAP_LINK: - return ROLE_SYSTEM_LINK; - case ui::AX_ROLE_INPUT_TIME: return ROLE_SYSTEM_GROUPING; @@ -2543,9 +2536,6 @@ case ui::AX_ROLE_NOTE: return ROLE_SYSTEM_GROUPING; - case ui::AX_ROLE_OUTLINE: - return ROLE_SYSTEM_OUTLINE; - case ui::AX_ROLE_POP_UP_BUTTON: { std::string html_tag = GetData().GetStringAttribute(ui::AX_ATTR_HTML_TAG); if (html_tag == "select") @@ -2583,12 +2573,6 @@ case ui::AX_ROLE_RUBY: return ROLE_SYSTEM_TEXT; - case ui::AX_ROLE_RULER: - return ROLE_SYSTEM_CLIENT; - - case ui::AX_ROLE_SCROLL_AREA: - return ROLE_SYSTEM_CLIENT; - case ui::AX_ROLE_SCROLL_BAR: return ROLE_SYSTEM_SCROLLBAR; @@ -2694,10 +2678,8 @@ case AX_ROLE_PANE: case AX_ROLE_PARAGRAPH: case AX_ROLE_PRESENTATIONAL: - case AX_ROLE_SEAMLESS_WEB_AREA: case AX_ROLE_SLIDER_THUMB: case AX_ROLE_SWITCH: - case AX_ROLE_TAB_GROUP: case AX_ROLE_TITLE_BAR: case AX_ROLE_UNKNOWN: case AX_ROLE_WEB_VIEW: @@ -2815,9 +2797,6 @@ case ui::AX_ROLE_MENU_LIST_OPTION: ia2_state &= ~(IA2_STATE_EDITABLE); break; - case ui::AX_ROLE_SCROLL_AREA: - ia2_state &= ~(IA2_STATE_EDITABLE); - break; case ui::AX_ROLE_TEXT_FIELD: case ui::AX_ROLE_SEARCH_BOX: if (data.HasState(ui::AX_STATE_MULTILINE)) { @@ -2943,12 +2922,6 @@ case ui::AX_ROLE_RUBY: ia2_role = IA2_ROLE_TEXT_FRAME; break; - case ui::AX_ROLE_RULER: - ia2_role = IA2_ROLE_RULER; - break; - case ui::AX_ROLE_SCROLL_AREA: - ia2_role = IA2_ROLE_SCROLL_PANE; - break; case ui::AX_ROLE_SEARCH: ia2_role = IA2_ROLE_SECTION; break; @@ -3185,7 +3158,6 @@ const AXNodeData& data) const { switch (data.role) { case ui::AX_ROLE_ARTICLE: - case ui::AX_ROLE_BUSY_INDICATOR: case ui::AX_ROLE_DEFINITION: case ui::AX_ROLE_DESCRIPTION_LIST: case ui::AX_ROLE_DESCRIPTION_LIST_TERM: @@ -3193,13 +3165,10 @@ case ui::AX_ROLE_IFRAME: case ui::AX_ROLE_IMAGE: case ui::AX_ROLE_IMAGE_MAP: - case ui::AX_ROLE_IMAGE_MAP_LINK: case ui::AX_ROLE_LIST: case ui::AX_ROLE_LIST_ITEM: case ui::AX_ROLE_PROGRESS_INDICATOR: case ui::AX_ROLE_ROOT_WEB_AREA: - case ui::AX_ROLE_RULER: - case ui::AX_ROLE_SCROLL_AREA: case ui::AX_ROLE_TERM: case ui::AX_ROLE_TIMER: case ui::AX_ROLE_TOOLBAR: @@ -3372,10 +3341,8 @@ } // Handle STATE_SYSTEM_LINKED - if (GetData().role == ui::AX_ROLE_IMAGE_MAP_LINK || - GetData().role == ui::AX_ROLE_LINK) { + if (GetData().role == ui::AX_ROLE_LINK) msaa_state |= STATE_SYSTEM_LINKED; - } return msaa_state; }
diff --git a/ui/accessibility/platform/ax_snapshot_node_android_platform.cc b/ui/accessibility/platform/ax_snapshot_node_android_platform.cc index 249ece3..9576dfc 100644 --- a/ui/accessibility/platform/ax_snapshot_node_android_platform.cc +++ b/ui/accessibility/platform/ax_snapshot_node_android_platform.cc
@@ -240,7 +240,7 @@ // static AX_EXPORT bool AXSnapshotNodeAndroid::AXRoleIsLink(AXRole role) { - return role == ui::AX_ROLE_LINK || role == ui::AX_ROLE_IMAGE_MAP_LINK; + return role == ui::AX_ROLE_LINK; } // static
diff --git a/ui/android/java/res/values-v17/styles.xml b/ui/android/java/res/values-v17/styles.xml index ab9e86e6..d517a3a 100644 --- a/ui/android/java/res/values-v17/styles.xml +++ b/ui/android/java/res/values-v17/styles.xml
@@ -95,6 +95,14 @@ <item name="android:textColor">@color/black_alpha_54</item> <item name="android:textSize">@dimen/text_size_small</item> </style> + <style name="BlackDenseListText1" tools:ignore="UnusedResources"> + <item name="android:textColor">@color/black_alpha_87</item> + <item name="android:textSize">@dimen/text_size_medium_dense</item> + </style> + <style name="BlackDenseListText2" tools:ignore="UnusedResources"> + <item name="android:textColor">@color/black_alpha_54</item> + <item name="android:textSize">@dimen/text_size_medium_dense</item> + </style> <style name="BlackButtonText" parent="RobotoMediumStyle"> <item name="android:textColor">@color/black_alpha_54</item> <item name="android:textSize">@dimen/text_size_medium</item>
diff --git a/ui/android/java/res/values/dimens.xml b/ui/android/java/res/values/dimens.xml index 0f1e2fb9e..11fabc86 100644 --- a/ui/android/java/res/values/dimens.xml +++ b/ui/android/java/res/values/dimens.xml
@@ -10,6 +10,7 @@ <dimen name="headline_size_medium">20sp</dimen> <dimen name="text_size_large">16sp</dimen> <dimen name="text_size_medium">14sp</dimen> + <dimen name="text_size_medium_dense">13sp</dimen> <dimen name="text_size_small">12sp</dimen> <dimen name="dropdown_item_height">50dp</dimen>
diff --git a/ui/app_list/app_list_features.cc b/ui/app_list/app_list_features.cc index 02409bd..8f4ba7a 100644 --- a/ui/app_list/app_list_features.cc +++ b/ui/app_list/app_list_features.cc
@@ -56,18 +56,6 @@ return base::FeatureList::IsEnabled(kEnablePlayStoreAppSearch); } -int AnswerCardMaxWidth() { - static const int max_width = base::GetFieldTrialParamByFeatureAsInt( - kEnableAnswerCard, "CardMaxWidth", 608); - return max_width; -} - -int AnswerCardMaxHeight() { - static const int max_height = base::GetFieldTrialParamByFeatureAsInt( - kEnableAnswerCard, "CardMaxHeight", 266); - return max_height; -} - std::string AnswerServerUrl() { return base::GetFieldTrialParamValueByFeature(kEnableAnswerCard, "ServerUrl"); }
diff --git a/ui/app_list/app_list_features.h b/ui/app_list/app_list_features.h index a4a6e68c..dd0f0eb 100644 --- a/ui/app_list/app_list_features.h +++ b/ui/app_list/app_list_features.h
@@ -40,8 +40,6 @@ bool APP_LIST_EXPORT IsFullscreenAppListEnabled(); bool APP_LIST_EXPORT IsTouchFriendlySearchResultsPageEnabled(); bool APP_LIST_EXPORT IsPlayStoreAppSearchEnabled(); -int APP_LIST_EXPORT AnswerCardMaxWidth(); -int APP_LIST_EXPORT AnswerCardMaxHeight(); std::string APP_LIST_EXPORT AnswerServerUrl(); std::string APP_LIST_EXPORT AnswerServerQuerySuffix();
diff --git a/ui/app_list/search_result.h b/ui/app_list/search_result.h index cd167806..510582b 100644 --- a/ui/app_list/search_result.h +++ b/ui/app_list/search_result.h
@@ -168,8 +168,10 @@ int percent_downloaded() const { return percent_downloaded_; } void SetPercentDownloaded(int percent_downloaded); - bool is_url() const { return is_url_; } - void set_is_url(bool is_url) { is_url_ = is_url; } + bool is_omnibox_search() const { return is_omnibox_search_; } + void set_is_omnibox_search(bool is_omnibox_search) { + is_omnibox_search_ = is_omnibox_search; + } // Returns the dimension at which this result's icon should be displayed. int GetPreferredIconDimension() const; @@ -256,9 +258,9 @@ bool is_installing_ = false; int percent_downloaded_ = 0; - // Indicates whether result is an omnibox url result. Set by OmniboxResult - // subclass. - bool is_url_ = false; + // Indicates whether result is an omnibox non-url search result. Set by + // OmniboxResult subclass. + bool is_omnibox_search_ = false; base::ObserverList<SearchResultObserver> observers_;
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc index 3a493c8..565836ed 100644 --- a/ui/app_list/views/app_list_view.cc +++ b/ui/app_list/views/app_list_view.cc
@@ -77,7 +77,7 @@ constexpr int kAppListBezelMargin = 50; // The blur radius of the app list background. -constexpr int kAppListBlurRadius = 20; +constexpr int kAppListBlurRadius = 30; // The vertical position for the appearing animation of the speech UI. constexpr float kSpeechUIAppearingPosition = 12; @@ -362,7 +362,9 @@ // makes it transparent. app_list_background_shield_ = new views::View; app_list_background_shield_->SetPaintToLayer(ui::LAYER_SOLID_COLOR); - app_list_background_shield_->layer()->SetOpacity(kAppListOpacity); + app_list_background_shield_->layer()->SetOpacity( + is_fullscreen_app_list_enabled_ ? kAppListOpacityWithBlur + : kAppListOpacity); SetBackgroundShieldColor(); if (features::IsBackgroundBlurEnabled()) { app_list_background_shield_->layer()->SetBackgroundBlur(
diff --git a/ui/app_list/views/app_list_view.h b/ui/app_list/views/app_list_view.h index 9051e30..d36aad6 100644 --- a/ui/app_list/views/app_list_view.h +++ b/ui/app_list/views/app_list_view.h
@@ -51,8 +51,11 @@ // The opacity of the app list background. static constexpr float kAppListOpacity = 0.8; + // The opacity of the app list background with blur. + static constexpr float kAppListOpacityWithBlur = 0.7; + // The preferred blend alpha with wallpaper color for background. - static constexpr int kDarkMutedBlendAlpha = 0x7F; + static constexpr int kDarkMutedBlendAlpha = 0x3f; // The defualt color of the app list background. static constexpr SkColor kDefaultBackgroundColor = SK_ColorBLACK;
diff --git a/ui/app_list/views/search_result_tile_item_view.cc b/ui/app_list/views/search_result_tile_item_view.cc index a5555da9..8d1e75a 100644 --- a/ui/app_list/views/search_result_tile_item_view.cc +++ b/ui/app_list/views/search_result_tile_item_view.cc
@@ -119,10 +119,14 @@ title()->SetEnabledColor(kGridTitleColorFullscreen); } else if (item_->display_type() == SearchResult::DISPLAY_TILE) { // Set solid color background to avoid broken text. See crbug.com/746563. - rating_->SetBackground( - views::CreateSolidBackground(kCardBackgroundColorFullscreen)); - price_->SetBackground( - views::CreateSolidBackground(kCardBackgroundColorFullscreen)); + if (rating_) { + rating_->SetBackground( + views::CreateSolidBackground(kCardBackgroundColorFullscreen)); + } + if (price_) { + price_->SetBackground( + views::CreateSolidBackground(kCardBackgroundColorFullscreen)); + } title()->SetBackground( views::CreateSolidBackground(kCardBackgroundColorFullscreen)); title()->SetFontList(base_font.DeriveWithSizeDelta(1));
diff --git a/ui/app_list/views/search_result_view.cc b/ui/app_list/views/search_result_view.cc index 822de1f..6d46fe2 100644 --- a/ui/app_list/views/search_result_view.cc +++ b/ui/app_list/views/search_result_view.cc
@@ -187,38 +187,46 @@ DCHECK(is_fullscreen_app_list_enabled_); std::unique_ptr<gfx::RenderText> render_text( gfx::RenderText::CreateInstance()); - // When result title is url, set title text using details. - render_text->SetText(result_->is_url() ? result_->details() - : result_->title()); + render_text->SetText(result_->title()); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); render_text->SetFontList( rb.GetFontList(ui::ResourceBundle::BaseFont).DeriveWithSizeDelta(2)); - // Empty details indicate omnibox non-url search type. When true, the matched - // tag indicates proposed query. When false, the matched tag indicates typed - // search query. - const bool is_omnibox_search = result_->details().empty(); - render_text->SetColor(is_omnibox_search ? kDefaultTextColor - : kMatchedTextColor); - const SearchResult::Tags& tags = - result_->is_url() ? result_->details_tags() : result_->title_tags(); + // When result is an omnibox non-url search, the matched tag indicates + // proposed query. For all other cases, the matched tag indicates typed search + // query. + render_text->SetColor(result_->is_omnibox_search() ? kDefaultTextColor + : kMatchedTextColor); + const SearchResult::Tags& tags = result_->title_tags(); for (const auto& tag : tags) { - if (tag.styles & SearchResult::Tag::MATCH) + if (tag.styles & SearchResult::Tag::URL) { + render_text->ApplyColor(kUrlColor, tag.range); + } else if (tag.styles & SearchResult::Tag::MATCH) { render_text->ApplyColor( - is_omnibox_search ? kMatchedTextColor : kDefaultTextColor, tag.range); + result_->is_omnibox_search() ? kMatchedTextColor : kDefaultTextColor, + tag.range); + } } title_text_ = std::move(render_text); } void SearchResultView::CreateDetailsRenderText() { DCHECK(is_fullscreen_app_list_enabled_); + // Ensures single line row for omnibox non-url search result. + if (result_->is_omnibox_search()) { + details_text_.reset(); + return; + } std::unique_ptr<gfx::RenderText> render_text( gfx::RenderText::CreateInstance()); - // When result title is url, set it to details text. - render_text->SetText(result_->is_url() ? result_->title() - : result_->details()); + render_text->SetText(result_->details()); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); render_text->SetFontList(rb.GetFontList(ui::ResourceBundle::BaseFont)); - render_text->SetColor(result_->is_url() ? kUrlColor : kDefaultTextColor); + render_text->SetColor(kDefaultTextColor); + const SearchResult::Tags& tags = result_->details_tags(); + for (const auto& tag : tags) { + if (tag.styles & SearchResult::Tag::URL) + render_text->ApplyColor(kUrlColor, tag.range); + } details_text_ = std::move(render_text); }
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc index dd75623..f63ab37 100644 --- a/ui/base/accelerators/accelerator.cc +++ b/ui/base/accelerators/accelerator.cc
@@ -301,4 +301,11 @@ return shortcut; } +// static +constexpr int AcceleratorTarget::kUnknownAcceleratorId; + +int AcceleratorTarget::GetAcceleratorId(const Accelerator& accelerator) const { + return kUnknownAcceleratorId; +} + } // namespace ui
diff --git a/ui/base/accelerators/accelerator.h b/ui/base/accelerators/accelerator.h index e6033bd..5f45429e 100644 --- a/ui/base/accelerators/accelerator.h +++ b/ui/base/accelerators/accelerator.h
@@ -125,6 +125,8 @@ // should implement. class UI_BASE_EXPORT AcceleratorTarget { public: + static constexpr int kUnknownAcceleratorId = -1; + // Should return true if the accelerator was processed. virtual bool AcceleratorPressed(const Accelerator& accelerator) = 0; @@ -133,6 +135,11 @@ // CanHandleAccelerators returns true. virtual bool CanHandleAccelerators() const = 0; + // Returns an ID to represent the action of the |accelerator|. Returns + // |kUnknownAcceleratorId| if the |accelerator| cannot be processed by this + // AcceleratorTarget or this function is not supported. + virtual int GetAcceleratorId(const Accelerator& accelerator) const; + protected: virtual ~AcceleratorTarget() {} };
diff --git a/ui/base/accelerators/accelerator_manager.cc b/ui/base/accelerators/accelerator_manager.cc index d5c8a5be..aad51373 100644 --- a/ui/base/accelerators/accelerator_manager.cc +++ b/ui/base/accelerators/accelerator_manager.cc
@@ -88,22 +88,41 @@ } bool AcceleratorManager::Process(const Accelerator& accelerator) { - bool result = false; AcceleratorMap::iterator map_iter = accelerators_.find(accelerator); - if (map_iter != accelerators_.end()) { - // We have to copy the target list here, because an AcceleratorPressed - // event handler may modify the list. - AcceleratorTargetList targets(map_iter->second.second); - for (AcceleratorTargetList::iterator iter = targets.begin(); - iter != targets.end(); ++iter) { - if ((*iter)->CanHandleAccelerators() && - (*iter)->AcceleratorPressed(accelerator)) { - result = true; - break; - } + if (map_iter == accelerators_.end()) + return false; + + // We have to copy the target list here, because an AcceleratorPressed + // event handler may modify the list. + AcceleratorTargetList targets(map_iter->second.second); + for (AcceleratorTargetList::iterator iter = targets.begin(); + iter != targets.end(); ++iter) { + if ((*iter)->CanHandleAccelerators() && + (*iter)->AcceleratorPressed(accelerator)) { + return true; } } - return result; + + return false; +} + +int AcceleratorManager::GetAcceleratorId(const Accelerator& accelerator) const { + AcceleratorMap::const_iterator map_iter = accelerators_.find(accelerator); + if (map_iter == accelerators_.end()) + return AcceleratorTarget::kUnknownAcceleratorId; + + const AcceleratorTargetList& targets = map_iter->second.second; + for (AcceleratorTargetList::const_iterator iter = targets.begin(); + iter != targets.end(); + iter++) { + if ((*iter)->CanHandleAccelerators()) { + const int accelerator_id = (*iter)->GetAcceleratorId(accelerator); + if (accelerator_id != AcceleratorTarget::kUnknownAcceleratorId) + return accelerator_id; + } + } + + return AcceleratorTarget::kUnknownAcceleratorId; } bool AcceleratorManager::HasPriorityHandler(
diff --git a/ui/base/accelerators/accelerator_manager.h b/ui/base/accelerators/accelerator_manager.h index c792b181..ea84c7c 100644 --- a/ui/base/accelerators/accelerator_manager.h +++ b/ui/base/accelerators/accelerator_manager.h
@@ -69,7 +69,7 @@ // Returns whether |accelerator| is already registered. bool IsRegistered(const Accelerator& accelerator) const; - // Activate the target associated with the specified accelerator. + // Activates the target associated with the specified accelerator. // First, AcceleratorPressed handler of the most recently registered target // is called, and if that handler processes the event (i.e. returns true), // this method immediately returns. If not, we do the same thing on the next @@ -77,6 +77,11 @@ // Returns true if an accelerator was activated. bool Process(const Accelerator& accelerator); + // Finds the target associated with the specified |accelerator| and returns + // its accelerator id. Returns |kUnknownAcceleratorId| if no target can handle + // the |accelerator|. + int GetAcceleratorId(const Accelerator& accelerator) const; + // Whether the given |accelerator| has a priority handler associated with it. bool HasPriorityHandler(const Accelerator& accelerator) const;
diff --git a/ui/base/accelerators/accelerator_manager_unittest.cc b/ui/base/accelerators/accelerator_manager_unittest.cc index 3cca7da..f27d2b9f 100644 --- a/ui/base/accelerators/accelerator_manager_unittest.cc +++ b/ui/base/accelerators/accelerator_manager_unittest.cc
@@ -20,8 +20,8 @@ class TestTarget : public AcceleratorTarget { public: - TestTarget() : accelerator_pressed_count_(0) {} - ~TestTarget() override {} + TestTarget() = default; + ~TestTarget() override = default; int accelerator_pressed_count() const { return accelerator_pressed_count_; @@ -31,12 +31,18 @@ accelerator_pressed_count_ = accelerator_pressed_count; } + void set_accelerator_id(int id) { + accelerator_id_ = id; + } + // Overridden from AcceleratorTarget: bool AcceleratorPressed(const Accelerator& accelerator) override; bool CanHandleAccelerators() const override; + int GetAcceleratorId(const Accelerator& accelerator) const override; private: - int accelerator_pressed_count_; + int accelerator_pressed_count_ = 0; + int accelerator_id_ = kUnknownAcceleratorId; DISALLOW_COPY_AND_ASSIGN(TestTarget); }; @@ -50,6 +56,10 @@ return true; } +int TestTarget::GetAcceleratorId(const Accelerator& accelerator) const { + return accelerator_id_; +} + Accelerator GetAccelerator(KeyboardCode code, int mask) { return Accelerator(code, mask); } @@ -289,5 +299,30 @@ EXPECT_EQ("Register a", delegate_.GetAndClearCommands()); } +TEST_F(AcceleratorManagerTest, GetAcceleratorId) { + const Accelerator accelerator(VKEY_A, EF_NONE); + TestTarget target_a; + TestTarget target_b; + + manager_.Register({accelerator}, + AcceleratorManager::kNormalPriority, + &target_b); + manager_.Register({accelerator}, + AcceleratorManager::kNormalPriority, + &target_a); + + EXPECT_EQ(AcceleratorTarget::kUnknownAcceleratorId, + manager_.GetAcceleratorId(accelerator)); + + target_a.set_accelerator_id(1); + EXPECT_EQ(1, manager_.GetAcceleratorId(accelerator)); + + target_b.set_accelerator_id(2); + EXPECT_EQ(1, manager_.GetAcceleratorId(accelerator)); + + target_a.set_accelerator_id(AcceleratorTarget::kUnknownAcceleratorId); + EXPECT_EQ(2, manager_.GetAcceleratorId(accelerator)); +} + } // namespace test } // namespace ui
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc index 687b813..cad674b 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc
@@ -328,7 +328,7 @@ void Compositor::SetScaleAndSize(float scale, const gfx::Size& size_in_pixel) { DCHECK_GT(scale, 0); - if (!size_in_pixel.IsEmpty()) { + if (!size_in_pixel.IsEmpty() && size_ != size_in_pixel) { size_ = size_in_pixel; host_->SetViewportSize(size_in_pixel); root_web_layer_->SetBounds(size_in_pixel);
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc index 4d35958..a0839908 100644 --- a/ui/keyboard/keyboard_controller.cc +++ b/ui/keyboard/keyboard_controller.cc
@@ -411,8 +411,8 @@ animation_observer_.reset(new CallbackAnimationObserver( container_animator, - base::Bind(&KeyboardController::HideAnimationFinished, - base::Unretained(this)))); + base::BindOnce(&KeyboardController::HideAnimationFinished, + base::Unretained(this)))); container_animator->AddObserver(animation_observer_.get()); ui::ScopedLayerAnimationSettings settings(container_animator); @@ -518,9 +518,9 @@ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&KeyboardController::HideKeyboard, - weak_factory_will_hide_.GetWeakPtr(), - HIDE_REASON_AUTOMATIC), + base::BindOnce(&KeyboardController::HideKeyboard, + weak_factory_will_hide_.GetWeakPtr(), + HIDE_REASON_AUTOMATIC), base::TimeDelta::FromMilliseconds(kHideKeyboardDelayMs)); return; default: @@ -770,8 +770,8 @@ case KeyboardControllerState::SHOWING: base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&KeyboardController::ReportLingeringState, - weak_factory_report_lingering_state_.GetWeakPtr()), + base::BindOnce(&KeyboardController::ReportLingeringState, + weak_factory_report_lingering_state_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(kReportLingeringStateDelayMs)); break; default:
diff --git a/ui/webui/resources/js/cr/ui/menu_button.js b/ui/webui/resources/js/cr/ui/menu_button.js index b68c1802..d54de2d 100644 --- a/ui/webui/resources/js/cr/ui/menu_button.js +++ b/ui/webui/resources/js/cr/ui/menu_button.js
@@ -43,7 +43,6 @@ */ decorate: function() { this.addEventListener('mousedown', this); - this.addEventListener('touchstart', this); this.addEventListener('keydown', this); this.addEventListener('dblclick', this); @@ -99,7 +98,6 @@ switch (e.type) { case 'mousedown': - case 'touchstart': if (e.currentTarget == this.ownerDocument) { if (e.target instanceof Node && !this.contains(e.target) && !this.menu.contains(e.target)) { @@ -110,8 +108,8 @@ } else { if (this.isMenuShown()) { this.hideMenu(); - } else if (e.type == 'mousedown' && e.button == 0) { - // Only show the menu when using left mouse button. + } else if (e.button == 0) { // Only show the menu when using left + // mouse button. this.showMenu(false, {x: e.screenX, y: e.screenY}); // Prevent the button from stealing focus on mousedown.